From 7c618b57cf376bead021cdad798d5e5b2d19b791 Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Tue, 25 Jul 2023 15:26:02 +0200 Subject: [PATCH] emails: Update subject for confirm_new_email to have realm host. Updates the email subject for confirming an email change to include the realm host. --- templates/zerver/emails/confirm_new_email.subject.txt | 2 +- zerver/actions/user_settings.py | 1 + zerver/tests/test_email_change.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/zerver/emails/confirm_new_email.subject.txt b/templates/zerver/emails/confirm_new_email.subject.txt index 637ea20aa3..406468c41a 100644 --- a/templates/zerver/emails/confirm_new_email.subject.txt +++ b/templates/zerver/emails/confirm_new_email.subject.txt @@ -1 +1 @@ -{{ _("Verify your new email address") }} +{% trans %}Verify your new email address for {{ organization_host }}{% endtrans %} diff --git a/zerver/actions/user_settings.py b/zerver/actions/user_settings.py index 118548a8c5..0125ef07d9 100644 --- a/zerver/actions/user_settings.py +++ b/zerver/actions/user_settings.py @@ -149,6 +149,7 @@ def do_start_email_change_process(user_profile: UserProfile, new_email: str) -> old_email=old_email, new_email=new_email, activate_url=activation_url, + organization_host=user_profile.realm.host, ) language = user_profile.default_language diff --git a/zerver/tests/test_email_change.py b/zerver/tests/test_email_change.py index b7ec6adef8..1c184140c7 100644 --- a/zerver/tests/test_email_change.py +++ b/zerver/tests/test_email_change.py @@ -39,7 +39,7 @@ class EmailChangeTestCase(ZulipTestCase): email_message = mail.outbox[0] self.assertEqual( email_message.subject, - "Verify your new email address", + "Verify your new email address for zulip.testserver", ) body = email_message.body self.assertIn("We received a request to change the email", body) @@ -168,7 +168,7 @@ class EmailChangeTestCase(ZulipTestCase): email_message = mail.outbox[0] self.assertEqual( email_message.subject, - "Verify your new email address", + "Verify your new email address for zulip.testserver", ) body = email_message.body self.assertIn("We received a request to change the email", body)