Notify users on login via e-mail#4824
Conversation
|
This also works well & looks nice - is there a way to skip this when hijack/"switch user" is utilized? not a huge deal but would be nice to not send a notification for that |
This I missed! No e-mail should be send in these cases I think, will take a look at that. |
06f7eba to
c689e6e
Compare
85054dc to
debb2bd
Compare
Fixed it now I believe. Should be on test site shortly. |
| from_email=settings.DEFAULT_FROM_EMAIL, | ||
| context={ | ||
| "user": user, | ||
| "login_time": formats.date_format(timezone.now(), "SHORT_DATETIME_FORMAT"), |
There was a problem hiding this comment.
on the test instance I have USE_TZ=true & TIME_ZONE='America/New_York' but for some reason the time is showing as 6pm when EST time is 2pm. any ideas on if I configed that wrong?
also thinking it could be beneficial to include the timezone abbreviation too for users of different timezones
There was a problem hiding this comment.
Sounds like it is using server time and not user time, will take a look at that. Confusing for users and misleading so good catch.
There was a problem hiding this comment.
@wes-otf I think I have fixed it now. Hypha in this PR now saved the user timezone to the session and uses that to format the datetime in the login notification e-mail. Also added the actual timezone.
This got me looking at how we display times in Hypha in general. Thanks to <relative-time> component we show local time in many places in Hypha. Will work on making that more complete in another PR.
There was a problem hiding this comment.
@wes-otf Deploying the updated PR to test now.
|
Switch user works as expected with no notification - nice work! I think this is ready to go, just had that small comment around timezones |
02a4e32 to
ca671ef
Compare
…he login notification e-mail.
Fixes #3549
Test Steps