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

Previously, the emails sent to the remote servers had the
'unsubscribe link' only present in the 'List-Unsubscribe' header.

Not all email clients expose that header.

So, this commit adds the link in the footer too.
This commit is contained in:
Prakhar Pratyush 2024-09-05 12:32:56 +05:30 committed by Tim Abbott
parent 00fb8f3014
commit e967226f8c
2 changed files with 2 additions and 0 deletions

View File

@ -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 %}

View File

@ -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")