diff --git a/templates/zerver/emails/invitation.source.html b/templates/zerver/emails/invitation.source.html index 68a8ff2cab..158bec2b66 100644 --- a/templates/zerver/emails/invitation.source.html +++ b/templates/zerver/emails/invitation.source.html @@ -8,7 +8,7 @@

{{ _("Hi there,") }}

- {% trans %}{{ referrer_full_name }} ({{ referrer_email }}) wants you to join them on Zulip — the team communication tool designed for productivity.{% endtrans %} + {% trans %}{{ referrer_full_name }} ({{ referrer_email }}) wants you to join them on Zulip — the team communication tool designed for productivity.{% endtrans %}

{{ _("To get started, click the button below.") }} diff --git a/templates/zerver/emails/invitation_reminder.source.html b/templates/zerver/emails/invitation_reminder.source.html index 728ae4a414..d3768c44ab 100644 --- a/templates/zerver/emails/invitation_reminder.source.html +++ b/templates/zerver/emails/invitation_reminder.source.html @@ -7,7 +7,7 @@ {% block content %}

{{ _("Hi again,") }}

-

{% trans %}This is a friendly reminder that {{ referrer_name }} ({{ referrer_email }}) wants you to join them on Zulip — the team communication tool designed for productivity.{% endtrans %}

+

{% trans %}This is a friendly reminder that {{ referrer_name }} ({{ referrer_email }}) wants you to join them on Zulip — the team communication tool designed for productivity.{% endtrans %}

{{ _("To get started, click the button below.") }} @@ -19,6 +19,10 @@

- {% trans %}This invitation expires in two days. If the invitation expires, you'll need to ask {{ referrer_name }} for another one.{% endtrans %} + {% trans %} + This invitation expires in two days. If the invitation expires, + you'll need to ask {{ referrer_name }} + for another one. + {% endtrans %}

{% endblock %} diff --git a/version.py b/version.py index fa193ed867..206525fb05 100644 --- a/version.py +++ b/version.py @@ -44,4 +44,4 @@ API_FEATURE_LEVEL = 3 # historical commits sharing the same major version, in which case a # minor version bump suffices. -PROVISION_VERSION = '82.0' +PROVISION_VERSION = '82.1' diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index 5e2755316f..61bbe9d862 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -47,6 +47,7 @@ from zerver.lib.send_email import send_future_email, FromAddress, \ from zerver.lib.initial_password import initial_password from zerver.lib.actions import ( do_get_user_invites, + do_change_full_name, do_deactivate_realm, do_deactivate_user, do_set_realm_property, @@ -1192,6 +1193,35 @@ earl-test@zulip.com""", ["Denmark"])) ) self.check_sent_emails([]) + def normalize_string(self, s: str) -> str: + s = s.strip() + return re.sub(r'\s+', ' ', s) + + def test_invite_links_in_name(self) -> None: + """ + If you invite an address already using Zulip, no invitation is sent. + """ + hamlet = self.example_user("hamlet") + self.login_user(hamlet) + # Test we properly handle links in user full names + do_change_full_name(hamlet, " https://www.google.com", hamlet) + + result = self.invite('newuser@zulip.com', ["Denmark"]) + self.assert_json_success(result) + self.check_sent_emails(['newuser@zulip.com']) + from django.core.mail import outbox + body = self.normalize_string(outbox[0].alternatives[0][0]) + + # Verify that one can't get Zulip to send invitation emails + # that third-party products will linkify using the full_name + # field, because we've included that field inside the mailto: + # link for the sender. + self.assertIn('</a> https://www.google.com (hamlet@zulip.com) wants', body) + + # TODO: Ideally, this test would also test the Invitation + # Reminder email generated, but the test setup for that is + # annoying. + def test_invite_some_existing_some_new(self) -> None: """ If you invite a mix of already existing and new users, invitations are