Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

remote_server_email: Add 'unsubscribe link' in the mail footer.

Prakhar Pratyushe967226f8cce
diff --git a/templates/zerver/emails/custom_email_base.pre.html b/templates/zerver/emails/custom_email_base.pre.html
index 06edc72f6a7..9eb792aa133 100644
--- a/templates/zerver/emails/custom_email_base.pre.html
+++ b/templates/zerver/emails/custom_email_base.pre.html
@@ -14,6 +14,7 @@
{% block manage_preferences %}
{% if remote_server_email %}
<p>You are receiving this email to update you about important changes to Zulip's Terms of Service.</p>
+ <a href="{{ unsubscribe_link }}">Unsubscribe</a>
{% elif unsubscribe_link %}
<p><a href="{{ realm_url }}/#settings/notifications">{{ _("Manage email preferences") }}</a> | <a href="{{ unsubscribe_link }}">{{ _("Unsubscribe from marketing emails") }}</a></p>
{% endif %}
diff --git a/zerver/tests/test_email_notifications.py b/zerver/tests/test_email_notifications.py
index 26cb9431d83..ecf9507b0be 100644
--- a/zerver/tests/test_email_notifications.py
+++ b/zerver/tests/test_email_notifications.py
@@ -89,6 +89,7 @@ class TestCustomEmails(ZulipTestCase):
"You are receiving this email to update you about important changes to Zulip",
str(msg.alternatives[0][0]),
)
+ self.assertIn("Unsubscribe", str(msg.alternatives[0][0]))
def test_send_custom_email_headers(self) -> None:
hamlet = self.example_user("hamlet")