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.

email-templates: Add account_registered email templates.

Lauryn Menardc491bef07b5c
diff --git a/templates/zerver/emails/account_registered.html b/templates/zerver/emails/account_registered.html
new file mode 100644
index 00000000000..7418a154c09
--- /dev/null
+++ b/templates/zerver/emails/account_registered.html
@@ -0,0 +1,62 @@
+{% extends "zerver/emails/email_base_default.html" %}
+
+{% block illustration %}
+<img src="{{ email_images_base_url }}/email_logo.png" alt=""/>
+{% 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>
+ {% trans %}You've joined the Zulip organization <b>{{ realm_name }}</b>.
+ {% endtrans %}
+</p>
+{% endif %}
+
+<p>
+ {% 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 %}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) %}Your account email: {{ email }}{% endtrans %}<br /></li>
+ {% endif %}
+ </ul>
+ <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 %}We also have a guide for <a href="{{ getting_organization_started_link }}">Setting up your organization</a>.{% endtrans %}
+ {% endif %}
+</p>
+
+<p>
+ {% if corporate_enabled %}
+ {% trans %}Questions? <a href="{{ support_email }}">Contact us</a> — we'd love to help!{% endtrans %}
+ {% else %}
+ {{macros.contact_us_self_hosted(support_email)}}
+ {% endif %}
+</p>
+{% endblock %}
diff --git a/templates/zerver/emails/account_registered.subject.txt b/templates/zerver/emails/account_registered.subject.txt
new file mode 100644
index 00000000000..53ab58234e1
--- /dev/null
+++ b/templates/zerver/emails/account_registered.subject.txt
@@ -0,0 +1,9 @@
+{% if realm_creation %}
+{% trans -%}
+{{ realm_name }} on Zulip: Your new organization details
+{%- endtrans %}
+{% else %}
+{% trans -%}
+{{ realm_name }} on Zulip: Your new account details
+{%- endtrans %}
+{% endif %}
diff --git a/templates/zerver/emails/account_registered.txt b/templates/zerver/emails/account_registered.txt
new file mode 100644
index 00000000000..2153c8dcc1b
--- /dev/null
+++ b/templates/zerver/emails/account_registered.txt
@@ -0,0 +1,39 @@
+{{ _('Welcome to Zulip!') }}
+
+{% if realm_creation %}
+ {% if is_demo_org %}
+ {% 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 %}Congratulations, you have created a new Zulip organization: {{ realm_name }}.{% endtrans %}
+ {% endif %}
+{% else %}
+{% trans %}You've joined the Zulip organization {{ realm_name }}.{% endtrans %}
+{% endif %}
+
+
+{% 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 %}Your username: {{ ldap_username }}{% endtrans %}
+{% else %}
+* {{ _('Use your LDAP account to log in') }}
+{% endif %}
+{% else %}
+* {% trans %}Your account email: {{ email }}{% endtrans %}
+{% endif %}
+
+
+{% trans %}If you are new to Zulip, check out our Getting started guide ({{ getting_user_started_link }})!{% endtrans %}
+{% if is_realm_admin %}
+{% trans %} We also have a guide for Setting up your organization ({{ getting_organization_started_link }}).{% endtrans %}
+{% endif %}
+
+
+{% if corporate_enabled %}
+ {% trans %}Questions? Contact us at {{ support_email }} — we'd love to help!{% endtrans %}
+{% else %}
+ {% trans %}If you have any questions, please contact this Zulip server's administrators at {{ support_email }}.{% endtrans %}
+{% endif %}
diff --git a/zerver/lib/email_notifications.py b/zerver/lib/email_notifications.py
index 926f7412ce4..96cf94205df 100644
--- a/zerver/lib/email_notifications.py
+++ b/zerver/lib/email_notifications.py
@@ -802,7 +802,7 @@ def send_account_registered_email(user: UserProfile, realm_creation: bool = Fals
break
send_future_email(
- "zerver/emails/followup_day1",
+ "zerver/emails/account_registered",
user.realm,
to_user_ids=[user.id],
from_name=from_name,
diff --git a/zerver/models.py b/zerver/models.py
index 1ab5903d6ee..858756bd818 100644
--- a/zerver/models.py
+++ b/zerver/models.py
@@ -4422,6 +4422,7 @@ class ScheduledMessage(models.Model):
EMAIL_TYPES = {
+ "account_registered": ScheduledEmail.WELCOME,
"followup_day1": ScheduledEmail.WELCOME,
"followup_day2": ScheduledEmail.WELCOME,
"onboarding_zulip_guide": ScheduledEmail.WELCOME,
diff --git a/zerver/tests/test_email_notifications.py b/zerver/tests/test_email_notifications.py
index 62b5a85f9a7..3c9f300c0ec 100644
--- a/zerver/tests/test_email_notifications.py
+++ b/zerver/tests/test_email_notifications.py
@@ -382,7 +382,8 @@ class TestFollowupEmails(ZulipTestCase):
)
self.assert_length(scheduled_emails, 3)
self.assertEqual(
- orjson.loads(scheduled_emails[0].data)["template_prefix"], "zerver/emails/followup_day1"
+ orjson.loads(scheduled_emails[0].data)["template_prefix"],
+ "zerver/emails/account_registered",
)
self.assertEqual(
orjson.loads(scheduled_emails[1].data)["template_prefix"], "zerver/emails/followup_day2"
@@ -407,7 +408,8 @@ class TestFollowupEmails(ZulipTestCase):
)
self.assert_length(scheduled_emails, 2)
self.assertEqual(
- orjson.loads(scheduled_emails[0].data)["template_prefix"], "zerver/emails/followup_day1"
+ orjson.loads(scheduled_emails[0].data)["template_prefix"],
+ "zerver/emails/account_registered",
)
self.assertEqual(
orjson.loads(scheduled_emails[1].data)["template_prefix"], "zerver/emails/followup_day2"
@@ -421,7 +423,8 @@ class TestFollowupEmails(ZulipTestCase):
scheduled_emails = ScheduledEmail.objects.filter(users=iago).order_by("scheduled_timestamp")
self.assert_length(scheduled_emails, 3)
self.assertEqual(
- orjson.loads(scheduled_emails[0].data)["template_prefix"], "zerver/emails/followup_day1"
+ orjson.loads(scheduled_emails[0].data)["template_prefix"],
+ "zerver/emails/account_registered",
)
self.assertEqual(
orjson.loads(scheduled_emails[1].data)["template_prefix"], "zerver/emails/followup_day2"
@@ -445,7 +448,8 @@ class TestFollowupEmails(ZulipTestCase):
)
self.assert_length(scheduled_emails, 2)
self.assertEqual(
- orjson.loads(scheduled_emails[0].data)["template_prefix"], "zerver/emails/followup_day1"
+ orjson.loads(scheduled_emails[0].data)["template_prefix"],
+ "zerver/emails/account_registered",
)
self.assertEqual(
orjson.loads(scheduled_emails[1].data)["template_prefix"],
@@ -468,7 +472,8 @@ class TestFollowupEmails(ZulipTestCase):
scheduled_emails = ScheduledEmail.objects.filter(users=cordelia)
self.assert_length(scheduled_emails, 1)
self.assertEqual(
- orjson.loads(scheduled_emails[0].data)["template_prefix"], "zerver/emails/followup_day1"
+ orjson.loads(scheduled_emails[0].data)["template_prefix"],
+ "zerver/emails/account_registered",
)
def test_followup_emails_for_regular_realms(self) -> None:
@@ -481,7 +486,8 @@ class TestFollowupEmails(ZulipTestCase):
assert scheduled_emails is not None
self.assert_length(scheduled_emails, 2)
self.assertEqual(
- orjson.loads(scheduled_emails[0].data)["template_prefix"], "zerver/emails/followup_day1"
+ orjson.loads(scheduled_emails[0].data)["template_prefix"],
+ "zerver/emails/account_registered",
)
self.assertEqual(
orjson.loads(scheduled_emails[1].data)["template_prefix"],
@@ -511,7 +517,8 @@ class TestFollowupEmails(ZulipTestCase):
assert scheduled_emails is not None
self.assert_length(scheduled_emails, 2)
self.assertEqual(
- orjson.loads(scheduled_emails[0].data)["template_prefix"], "zerver/emails/followup_day1"
+ orjson.loads(scheduled_emails[0].data)["template_prefix"],
+ "zerver/emails/account_registered",
)
self.assertEqual(
orjson.loads(scheduled_emails[1].data)["template_prefix"],
diff --git a/zerver/tests/test_i18n.py b/zerver/tests/test_i18n.py
index 48b4cebc7ed..c15b7e08dec 100644
--- a/zerver/tests/test_i18n.py
+++ b/zerver/tests/test_i18n.py
@@ -70,7 +70,7 @@ class EmailTranslationTestCase(ZulipTestCase):
with self.settings(DEVELOPMENT_LOG_EMAILS=True):
enqueue_welcome_emails(hamlet)
# TODO: Uncomment and replace with translation once we have German translations for the strings
- # in followup_day1 emails.
+ # in account_registered emails.
# check_translation("Viele Grüße", "")