diff --git a/templates/zerver/emails/notify_new_login.source.html b/templates/zerver/emails/notify_new_login.source.html index 23a3b0d9aa..b6ed841c33 100644 --- a/templates/zerver/emails/notify_new_login.source.html +++ b/templates/zerver/emails/notify_new_login.source.html @@ -10,7 +10,7 @@
Login details:
Server: {{ realm_uri }}
-Account: {{ user.email }}
+Account: {{ user_email }}
Time: {{ device_info.login_time }}
Device: {{ device_info.device_browser if device_info.device_browser else 'An unknown browser' }} on {{ device_info.device_os if device_info.device_os else 'an unknown operating system' }}.
IP Address: {{ device_info.device_ip }}
diff --git a/templates/zerver/emails/notify_new_login.txt b/templates/zerver/emails/notify_new_login.txt index 1898590770..b44b56053c 100644 --- a/templates/zerver/emails/notify_new_login.txt +++ b/templates/zerver/emails/notify_new_login.txt @@ -4,7 +4,7 @@ This is a notification that a new login to your Zulip account has just occurred. Login details: Server: {{ realm_uri }} -Account: {{ user.email }} +Account: {{ user_email }} Time: {{ device_info.login_time }} Device: {{ device_info.device_browser if device_info.device_browser else 'an unknown browser' }} on {{ device_info.device_os if device_info.device_os else 'an unknown operating system' }}. IP Address: {{ device_info.device_ip }} diff --git a/zerver/signals.py b/zerver/signals.py index f4332e0627..390faa26ef 100644 --- a/zerver/signals.py +++ b/zerver/signals.py @@ -81,7 +81,7 @@ def email_on_new_login(sender: Any, user: UserProfile, request: Any, **kwargs: A context = common_context(user) context['device_info'] = device_info - context['user'] = user + context['user_email'] = user.email email_dict = { 'template_prefix': 'zerver/emails/notify_new_login',