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.

emails: Improve followup_day1 (registration confirmation) email.

Alya Abbott27b703f61722
diff --git a/templates/zerver/emails/followup_day1.source.html b/templates/zerver/emails/followup_day1.source.html
index 8a8b15f4e6b..997af015873 100644
--- a/templates/zerver/emails/followup_day1.source.html
+++ b/templates/zerver/emails/followup_day1.source.html
@@ -5,51 +5,55 @@
{% endblock %}
{% block content %}
+{% if realm_creation %}
+{% if is_demo_org %}
+<p>
+ {% trans demo_organizations_help_link="https://zulip.com/help/demo-organizations" %}Congratulations, you have created a new Zulip demo organization. Note
+ that this organization will be automatically deleted in 30 days. Learn more
+ about demo organizations <a
+ href="{{ demo_organizations_help_link }}">here</a>!
+ {% endtrans %}
+</p>
+{% else %}
+<p>
+ {% trans %}Congratulations, you have created a new Zulip
+ organization: <b>{{ realm_name }}</b>.{% endtrans %}
+</p>
+{% endif %}
+{% else %}
<p>{{ _('Welcome to Zulip!') }}</p>
-
<p>
- {% if realm_creation %}
- {% if is_demo_org %}
- {% trans %}You've created a demo Zulip organization. Note that this organization will be automatically deleted in 30 days. Learn more about demo organizations <a href="https://zulip.com/help/demo-organizations">here</a>!{% endtrans %}
- {% else %}
- {% trans %}You've created the new Zulip organization <b>{{ realm_name }}</b>.{% endtrans %}
- {% endif %}
- {% else %}
- {% trans %}You've joined the Zulip organization <b>{{ realm_name }}</b>.{% endtrans %}
- {% endif %}
+ {% trans %}You've joined the Zulip organization <b>{{ realm_name }}</b>.
+ {% endtrans %}
</p>
+{% endif %}
<p>
- {{ _('Your account details:') }}
+ {% trans apps_page_link="https://zulip.com/apps" %}You will use the following info to log into the Zulip web, <a href="{{ apps_page_link }}">mobile and desktop</a> apps:{% endtrans %}
<ul>
<li>{% trans organization_url=macros.link_tag(realm_uri) %}Organization URL: {{ organization_url }}{% endtrans %}<br /></li>
{% if ldap %}
{% if ldap_username %}
- <li>{% trans %}Username: {{ ldap_username }}{% endtrans %}<br /></li>
+ <li>{% trans %}Your username: {{ ldap_username }}{% endtrans %}<br /></li>
{% else %}
<li>{{ _('Use your LDAP account to log in') }}<br /></li>
{% endif %}
{% else %}
- <li>{% trans email=macros.email_tag(email) %}Email: {{ email }}{% endtrans %}<br /></li>
+ <li>{% trans email=macros.email_tag(email) %}Your account email: {{ email }}{% endtrans %}<br /></li>
{% endif %}
</ul>
- {% trans apps_page_link="https://zulip.com/apps" %}(you'll need these to sign in to the <a href="{{ apps_page_link }}">mobile and desktop</a> apps){% endtrans %}
+ <a class="button" href="{{ realm_uri }}">{{ _('Go to organization') }}</a>
</p>
<p>
+ {% trans %}If you are new to Zulip, check out our <a href="{{ getting_user_started_link }}">Getting started guide</a>!{% endtrans %}
{% if is_realm_admin %}
- {% trans %}Check out our <a href="{{ getting_started_link }}">guide for admins</a>, become a Zulip pro with a few <a href="{{ keyboard_shortcuts_link }}">keyboard shortcuts</a>, or <a href="{{ realm_uri }}">dive right in</a>!{% endtrans %}
- {% else %}
- {% trans %}<a href="{{ getting_started_link }}">Learn more</a> about Zulip, become a pro with a few <a href="{{ keyboard_shortcuts_link }}">keyboard shortcuts</a>, or <a href="{{ realm_uri }}">dive right in</a>!{% endtrans %}
+ {% trans %}We also have a guide for <a href="{{ getting_organization_started_link }}">Setting up your organization</a>.{% endtrans %}
{% endif %}
</p>
<p>
- {{ _("Cheers,") }}<br />
- {{ _("Team Zulip") }}
-</p>
-
-<p>
- {% trans %}PS: Follow us on <a href="https://twitter.com/zulip">Twitter</a>, star us on <a href="https://github.com/zulip/zulip">GitHub</a>, or chat with us live on the <a href="https://zulip.com/development-community/">Zulip community server</a>!{% endtrans %}
+ {% trans support_email=macros.email_tag(support_email) %}Questions? Contact
+us any time at {{ support_email }}.{% endtrans %}
</p>
{% endblock %}
diff --git a/templates/zerver/emails/followup_day1.txt b/templates/zerver/emails/followup_day1.txt
index 149244f0ea0..c9034d7e239 100644
--- a/templates/zerver/emails/followup_day1.txt
+++ b/templates/zerver/emails/followup_day1.txt
@@ -2,38 +2,31 @@
{% if realm_creation %}
{% if is_demo_org %}
- {% trans %}You've created a demo Zulip organization. Note that this organization will be automatically deleted in 30 days. Learn more about demo organizations here: https://zulip.com/help/demo-organizations{% endtrans %}
+ {% trans demo_organizations_help_link="https://zulip.com/help/demo-organizations" %} Congratulations, you have created a new demo Zulip organization. Note that this organization will be automatically deleted in 30 days. Learn more about demo organizations here: {{ demo_organizations_help_link }}!{% endtrans %}
{% else %}
- {% trans %}You've created the new Zulip organization {{ realm_name }}.{% endtrans %}
+ {% trans %}Congratulations, you have created a new Zulip organization: {{ realm_name }}.{% endtrans %}
{% endif %}
-{% trans %}You've created the new Zulip organization {{ realm_name }}.{% endtrans %}
{% else %}
{% trans %}You've joined the Zulip organization {{ realm_name }}.{% endtrans %}
{% endif %}
-{{ _('Your account details:') }}
+{% trans apps_page_link="https://zulip.com/apps" %}You will use the following info to log into the Zulip web, mobile and desktop apps ({{ apps_page_link}}):{% endtrans %}
+
* {% trans organization_url=realm_uri %}Organization URL: {{ organization_url }}{% endtrans %}
+
{% if ldap %}
{% if ldap_username %}
-* {% trans %}Username: {{ ldap_username }}{% endtrans %}
+* {% trans %}Your username: {{ ldap_username }}{% endtrans %}
{% else %}
* {{ _('Use your LDAP account to log in') }}
{% endif %}
{% else %}
-* {% trans %}Email: {{ email }}{% endtrans %}
+* {% trans %}Your account email: {{ email }}{% endtrans %}
{% endif %}
-{% trans apps_page_link="https://zulip.com/apps" %}(you'll need these to sign in to the mobile and desktop apps ({{ apps_page_link }})){% endtrans %}
+{% trans %}If you are new to Zulip, check out our Getting started guide ({{ getting_user_started_link }})!{% endtrans %}
{% if is_realm_admin %}
-{% trans %}Check out our guide ({{ getting_started_link }}) for admins, become a Zulip pro with a few keyboard shortcuts ({{ keyboard_shortcuts_link }}), or dive right in to {{ realm_uri }}!{% endtrans %}
-{% else %}
-{% trans %}Learn more ({{ getting_started_link }}) about Zulip, become a pro with a few keyboard shortcuts ({{ keyboard_shortcuts_link }}), or dive right in to {{ realm_uri }}!{% endtrans %}
+{% trans %} We also have a guide for Setting up your organization ({{ getting_organization_started_link }}).{% endtrans %}
{% endif %}
-
-
-{{ _("Cheers,") }}
-{{ _("Team Zulip") }}
-
-{% trans %}PS: Check us out on Twitter (@zulip), star us on GitHub (https://github.com/zulip/zulip), or chat with us live on the Zulip community server (https://zulip.com/development-community/)!{% endtrans %}
diff --git a/zerver/lib/email_notifications.py b/zerver/lib/email_notifications.py
index 9aca51e2b0c..9cab9284562 100644
--- a/zerver/lib/email_notifications.py
+++ b/zerver/lib/email_notifications.py
@@ -687,12 +687,11 @@ def enqueue_welcome_emails(user: UserProfile, realm_creation: bool = False) -> N
is_realm_admin=user.is_realm_admin,
is_demo_org=user.realm.demo_organization_scheduled_deletion_date is not None,
)
- if user.is_realm_admin:
- context["getting_started_link"] = (
- user.realm.uri + "/help/getting-your-organization-started-with-zulip"
- )
- else:
- context["getting_started_link"] = "https://zulip.com"
+
+ context["getting_organization_started_link"] = (
+ user.realm.uri + "/help/getting-your-organization-started-with-zulip"
+ )
+ context["getting_user_started_link"] = user.realm.uri + "/help/getting-started-with-zulip"
# Imported here to avoid import cycles.
from zproject.backends import ZulipLDAPAuthBackend, email_belongs_to_ldap
diff --git a/zerver/tests/test_email_notifications.py b/zerver/tests/test_email_notifications.py
index 9ea8bb645da..496fab74c92 100644
--- a/zerver/tests/test_email_notifications.py
+++ b/zerver/tests/test_email_notifications.py
@@ -214,7 +214,10 @@ class TestFollowupEmails(ZulipTestCase):
email_data = orjson.loads(scheduled_emails[0].data)
self.assertEqual(email_data["context"]["email"], self.example_email("hamlet"))
self.assertEqual(email_data["context"]["is_realm_admin"], False)
- self.assertEqual(email_data["context"]["getting_started_link"], "https://zulip.com")
+ self.assertEqual(
+ email_data["context"]["getting_user_started_link"],
+ "http://zulip.testserver/help/getting-started-with-zulip",
+ )
self.assertNotIn("ldap_username", email_data["context"])
ScheduledEmail.objects.all().delete()
@@ -226,9 +229,13 @@ class TestFollowupEmails(ZulipTestCase):
self.assertEqual(email_data["context"]["email"], self.example_email("iago"))
self.assertEqual(email_data["context"]["is_realm_admin"], True)
self.assertEqual(
- email_data["context"]["getting_started_link"],
+ email_data["context"]["getting_organization_started_link"],
"http://zulip.testserver/help/getting-your-organization-started-with-zulip",
)
+ self.assertEqual(
+ email_data["context"]["getting_user_started_link"],
+ "http://zulip.testserver/help/getting-started-with-zulip",
+ )
self.assertNotIn("ldap_username", email_data["context"])
# See https://zulip.readthedocs.io/en/latest/production/authentication-methods.html#ldap-including-active-directory
@@ -350,7 +357,7 @@ class TestFollowupEmails(ZulipTestCase):
self.assert_length(outbox, 1)
message = outbox[0]
- self.assertIn("You've created the new Zulip organization", message.body)
+ self.assertIn("you have created a new Zulip organization", message.body)
self.assertNotIn("demo org", message.body)
def test_followup_emails_for_demo_realms(self) -> None:
@@ -372,7 +379,7 @@ class TestFollowupEmails(ZulipTestCase):
self.assert_length(outbox, 1)
message = outbox[0]
- self.assertIn("You've created a demo Zulip organization", message.body)
+ self.assertIn("you have created a new demo Zulip organization", message.body)
class TestMissedMessages(ZulipTestCase):
diff --git a/zerver/tests/test_i18n.py b/zerver/tests/test_i18n.py
index 1a7a819462f..ff73ec9ea3b 100644
--- a/zerver/tests/test_i18n.py
+++ b/zerver/tests/test_i18n.py
@@ -69,7 +69,9 @@ class EmailTranslationTestCase(ZulipTestCase):
with self.settings(DEVELOPMENT_LOG_EMAILS=True):
enqueue_welcome_emails(hamlet)
- check_translation("Viele Grüße", "")
+ # TODO: Uncomment and replace with translation once we have German translations for the strings
+ # in followup_day1 emails.
+ # check_translation("Viele Grüße", "")
class TranslationTestCase(ZulipTestCase):