mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 12:54:58 +00:00
emails: Make it obvious when registering creates new realm.
Checked the email looked OK in `/emails` for both creating realm and registering within an existing one. Not sure zerver/tests/test_i18n.py test has been suppressed correctly. Fixes #17786.
This commit is contained in:
committed by
Tim Abbott
parent
bf179b7d2f
commit
e4d9e58c7d
@@ -6,10 +6,18 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>
|
<p>
|
||||||
|
{% if create_realm %}
|
||||||
|
{{ _('You have requested a new Zulip organization. Awesome!') }}
|
||||||
|
{% else %}
|
||||||
{{ _('You recently signed up for Zulip. Awesome!') }}
|
{{ _('You recently signed up for Zulip. Awesome!') }}
|
||||||
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
{% if create_realm %}
|
||||||
|
{{ _('Click the button below to create the organization and register your account.') }}
|
||||||
|
{% else %}
|
||||||
{{ _('Click the button below to complete registration.') }}
|
{{ _('Click the button below to complete registration.') }}
|
||||||
|
{% endif %}
|
||||||
<a class="button" href="{{ activate_url }}">{{ _('Complete registration') }}</a>
|
<a class="button" href="{{ activate_url }}">{{ _('Complete registration') }}</a>
|
||||||
</p>
|
</p>
|
||||||
<p>{% trans support_email=macros.email_tag(support_email) %}Contact us any time at {{ support_email }} if you run into trouble, have any feedback, or just want to chat!{% endtrans %}</p>
|
<p>{% trans support_email=macros.email_tag(support_email) %}Contact us any time at {{ support_email }} if you run into trouble, have any feedback, or just want to chat!{% endtrans %}</p>
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
|
{% if create_realm %}
|
||||||
|
{{ _("Create your Zulip organization") }}
|
||||||
|
{% else %}
|
||||||
{{ _("Activate your Zulip account") }}
|
{{ _("Activate your Zulip account") }}
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
|
{% if create_realm %}
|
||||||
|
{{ _('You have requested a new Zulip organization. Awesome!') }}
|
||||||
|
{% else %}
|
||||||
{{ _('You recently signed up for Zulip. Awesome!') }}
|
{{ _('You recently signed up for Zulip. Awesome!') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{{ _('Click the link below to complete registration.') }}
|
{% if create_realm %}
|
||||||
|
{{ _('Click the button below to create the organization and register your account.') }}
|
||||||
|
{% else %}
|
||||||
|
{{ _('Click the button below to complete registration.') }}
|
||||||
|
{% endif %}
|
||||||
<{{ activate_url }}>
|
<{{ activate_url }}>
|
||||||
|
|
||||||
{% trans %}Contact us any time at {{ support_email }} if you run into trouble,have any feedback, or just want to chat!{% endtrans %}
|
{% trans %}Contact us any time at {{ support_email }} if you run into trouble,have any feedback, or just want to chat!{% endtrans %}
|
||||||
|
|||||||
@@ -649,6 +649,8 @@ Output:
|
|||||||
email_address: str,
|
email_address: str,
|
||||||
*,
|
*,
|
||||||
url_pattern: Optional[str] = None,
|
url_pattern: Optional[str] = None,
|
||||||
|
email_subject_contains: Optional[str] = None,
|
||||||
|
email_body_contains: Optional[str] = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
from django.core.mail import outbox
|
from django.core.mail import outbox
|
||||||
|
|
||||||
@@ -661,6 +663,13 @@ Output:
|
|||||||
):
|
):
|
||||||
match = re.search(url_pattern, message.body)
|
match = re.search(url_pattern, message.body)
|
||||||
assert match is not None
|
assert match is not None
|
||||||
|
|
||||||
|
if email_subject_contains:
|
||||||
|
self.assertIn(email_subject_contains, message.subject)
|
||||||
|
|
||||||
|
if email_body_contains:
|
||||||
|
self.assertIn(email_body_contains, message.body)
|
||||||
|
|
||||||
[confirmation_url] = match.groups()
|
[confirmation_url] = match.groups()
|
||||||
return confirmation_url
|
return confirmation_url
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -2769,8 +2769,13 @@ class RealmCreationTest(ZulipTestCase):
|
|||||||
result = self.client_get(result["Location"])
|
result = self.client_get(result["Location"])
|
||||||
self.assert_in_response("Check your email so we can get started.", result)
|
self.assert_in_response("Check your email so we can get started.", result)
|
||||||
|
|
||||||
# Visit the confirmation link.
|
# Check confirmation email has the correct subject and body, extract
|
||||||
confirmation_url = self.get_confirmation_url_from_outbox(email)
|
# confirmation link and visit it
|
||||||
|
confirmation_url = self.get_confirmation_url_from_outbox(
|
||||||
|
email,
|
||||||
|
email_subject_contains="Create your Zulip organization",
|
||||||
|
email_body_contains="You have requested a new Zulip organization",
|
||||||
|
)
|
||||||
result = self.client_get(confirmation_url)
|
result = self.client_get(confirmation_url)
|
||||||
self.assertEqual(result.status_code, 200)
|
self.assertEqual(result.status_code, 200)
|
||||||
|
|
||||||
|
|||||||
@@ -534,7 +534,10 @@ def send_confirm_registration_email(
|
|||||||
to_emails=[email],
|
to_emails=[email],
|
||||||
from_address=FromAddress.tokenized_no_reply_address(),
|
from_address=FromAddress.tokenized_no_reply_address(),
|
||||||
language=language,
|
language=language,
|
||||||
context={"activate_url": activation_url},
|
context={
|
||||||
|
"create_realm": (realm is None),
|
||||||
|
"activate_url": activation_url,
|
||||||
|
},
|
||||||
realm=realm,
|
realm=realm,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user