Skip to content

Notify users on login via e-mail#4824

Open
frjo wants to merge 4 commits into
mainfrom
feature/notificate-user-login
Open

Notify users on login via e-mail#4824
frjo wants to merge 4 commits into
mainfrom
feature/notificate-user-login

Conversation

@frjo
Copy link
Copy Markdown
Member

@frjo frjo commented Apr 21, 2026

Fixes #3549

Test Steps

  • Check that user receives en e-mail on login.
  • Check that the e-mail content is correct and informative.

@frjo frjo added Type: Feature This is something new (not an enhancement of an existing thing). Type: Patch Mini change, used in release drafter Status: Needs testing Tickets that need testing/qa Status: Needs dev testing 🧑‍💻 Tasks that should be tested by the dev team labels Apr 21, 2026
@wes-otf
Copy link
Copy Markdown
Contributor

wes-otf commented Apr 22, 2026

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

@frjo
Copy link
Copy Markdown
Member Author

frjo commented Apr 22, 2026

This also works well & looks nice - is there a way to skip this when hijack/"switch user" is utilized?

This I missed! No e-mail should be send in these cases I think, will take a look at that.

@frjo frjo force-pushed the feature/notificate-user-login branch from 06f7eba to c689e6e Compare May 1, 2026 19:39
@frjo frjo force-pushed the feature/notificate-user-login branch from c689e6e to 85054dc Compare May 14, 2026 08:42
@frjo frjo force-pushed the feature/notificate-user-login branch from 85054dc to debb2bd Compare May 17, 2026 19:54
@frjo
Copy link
Copy Markdown
Member Author

frjo commented May 17, 2026

is there a way to skip this when hijack/"switch user" is utilized?

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"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@wes-otf
Copy link
Copy Markdown
Contributor

wes-otf commented May 25, 2026

Switch user works as expected with no notification - nice work! I think this is ready to go, just had that small comment around timezones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Needs dev testing 🧑‍💻 Tasks that should be tested by the dev team Status: Needs testing Tickets that need testing/qa Type: Feature This is something new (not an enhancement of an existing thing). Type: Patch Mini change, used in release drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Hypha send an e-mail to the user on each successful login

2 participants