-
Notifications
You must be signed in to change notification settings - Fork 138
feat: add request info to all emails #431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can we use translations by Google Translator in this project? |
Hello @jozefrebjak , I agree to the following terms with this PR:
Please add
I am against adding and changing the default templates, the reason is that in a real project each site has its own theme and the email templates are the same as the site theme, so I believe that in the real project the email templates are also The face is designed exclusively and we do not need to add details in the shield.
In the final stages of this PR, we can get help from our friends for translation. Therefore, we must first see what the members think. Refactor |
src/Language/en/Auth.php
Outdated
@@ -64,6 +64,12 @@ | |||
'userDoesNotExist' => 'Password was not changed. User does not exist', | |||
'resetTokenExpired' => 'Sorry. Your reset token has expired.', | |||
|
|||
// Email Globals | |||
'emailInfo' => 'Some information about the person who asked for the code:', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write in such a way that it covers the magic link
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@datamweb I'd rather add a new line for the magic link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the need to add a new line on this.
You can use the phrase "Applicant information:" or something similar. Because in magic-link
we do not send code
, a link
is sent.
However, if you think adding new line would be useful for the Shield, I have no problem with it.
An intriguing question! I did some digging, and the answer is murky but "yes". Here is an excerpt from WikiMedia's legal team who had to answer this for their services:
So two interpretations:
In both cases since @jozefrebjak is the originating author and the one using the translation software he is the sole owner of the content and may submit it based on our license and agreement. |
@MGatner Very interesting opinion. Can you give the URL of the WikiMedia's legal team answer? |
Here ya go: https://meta.m.wikimedia.org/wiki/Wikilegal/Copyright_for_Google_Translations Specifically "Copyright in Translations" |
Please fix the failed test: 1) Tests\Controllers\ActionsTest::testEmailActivateShow |
Untranslated language files cause test failures. --- a/src/Language/fa/Auth.php
+++ b/src/Language/fa/Auth.php
@@ -74,10 +74,10 @@
'resetTokenExpired' => 'متاسفانه، توکن بازنشانی شما منقضی شده است.',
// Email Globals
- 'emailInfo' => 'Some information about the person who asked for the code:',
- 'emailIpAddress' => 'IP Address:',
- 'emailDevice' => 'Device:',
- 'emailDate' => 'Date:',
+ 'emailInfo' => '(To be translated) Some information about the person who asked for the code:',
+ 'emailIpAddress' => '(To be translated) IP Address:',
+ 'emailDevice' => '(To be translated) Device:',
+ 'emailDate' => '(To be translated) Date:',
// 2FA
'email2FATitle' => 'احراز هویت دو عاملی', |
Good idea how to handle missing languages. |
For me is date enough, but I can change this to return also time. Time::now()->toLocalizedString('MMM d, yyyy'); I'm fine with html email like they are now. I have added for now only a few basic HTML tags, which I believe we should support in default email templates. I'd like to learn how to use View Decorators to provide some kind of templating system, but I don't have experience with that yet. |
Please add, maybe this is better.
Okay. Because you have made some changes, the test has an error, please correct the following to fix it. shield/tests/Controllers/ActionsTest.php Lines 233 to 241 in 5c1a9af
more info see : https://github.com/codeigniter4/shield/actions/runs/3061616247/jobs/4941607181
In this regard, since other members did not comment, there is no need to change. But if you want to learn, watch this video. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'emailInfo' => 'Beberapa informasi tentang seseorang yang meminta kode:',
'emailIpAddress' => 'Alamat IP:',
'emailDevice' => 'Perangkat:',
'emailDate' => 'Tanggal:',
@ddevsr thank you for your help. |
Hello @jozefrebjak , can you continue this PR? |
Some of your commits are unsigned, please check GPG-Signing Old Commits, also note other comments. |
@datamweb I signed the latest commit, but the older ones were not signed. The rebase method is completely new to me, so if you provide me with how to sign them, I will. |
I recommend you set git sign automatically.
Then, just to run
|
Co-authored-by: kenjis <kenji.uui@gmail.com>
Co-authored-by: kenjis <kenji.uui@gmail.com>
I got it. The last merge commit broke the branch.
All you need to do is:
Resetting the last commit makes the git log graph straight.
|
Co-authored-by: Pooya Parsa Dadashi <pooya_parsa_dadashi@yahoo.com>
Co-authored-by: Pooya Parsa Dadashi <pooya_parsa_dadashi@yahoo.com>
Co-authored-by: Pooya Parsa Dadashi <pooya_parsa_dadashi@yahoo.com>
Co-authored-by: Pooya Parsa Dadashi <pooya_parsa_dadashi@yahoo.com>
hello @jozefrebjak, |
@datamweb This PR was about verification emails, I would like to make another PR about the magic link email. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, Google translator is limited here.
The unit test doesn't fully cover it, however I don't mind.
Also note that we are in the process of releasing a new version, if possible send out the magic link PR as soon as possible. (Honestly, I believe that should have been done in this PR as well.)
Thank you.
@datamweb Ok, please leave it open, I'll add support for magic link as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes. good work.
Co-authored-by: Pooya Parsa Dadashi <pooya_parsa_dadashi@yahoo.com>
All checks have passed. I'm merging. |
It is common practice to include in email verification emails some user request info like
IP Address
,User Agent Device
&Date
when a user is asked for some code. This PR adds this information.I also improved default email templates to improve readability of the
code
.@lonnieezell @kenjis @MGatner I don't know if we want to provide more complex Email templates, or if basic HTML is fine for the start of using this library and leave it completely to the developer.
Language files are not completed, some translated with Google Translator.
Please help with translations.
Here is what it looks like now in the Email client.