From dcea17eb4496ffa708c90b2d57dd7bc56b2400a2 Mon Sep 17 00:00:00 2001 From: Ujjwal Aggarwal Date: Mon, 20 Feb 2023 22:54:28 +0530 Subject: [PATCH] emails: Improve "contact us" line in onboarding emails. Several onboarding emails sent to new users/organizations used the same "contact us" language. Adds new macros for the "contact us" line for Zulip Cloud and self-hosted realms to eliminate repetition. The suitable macro for Zulip Cloud vs self-hosted organizations is decided conditionally, by checking corporate_enabled. Fixes #24260. --- templates/zerver/emails/confirm_registration.html | 8 +++++++- templates/zerver/emails/followup_day1.html | 7 +++++-- templates/zerver/emails/invitation.html | 6 +++++- templates/zerver/emails/macros.html | 8 ++++++++ templates/zerver/emails/realm_reactivation.html | 8 +++++++- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/templates/zerver/emails/confirm_registration.html b/templates/zerver/emails/confirm_registration.html index bb20f7c5db..3ff3cc0b84 100644 --- a/templates/zerver/emails/confirm_registration.html +++ b/templates/zerver/emails/confirm_registration.html @@ -20,5 +20,11 @@ {% endif %} {{ _('Complete registration') }}

-

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

+

+ {% if corporate_enabled %} + {{macros.contact_us_zulip_cloud(support_email)}} + {% else %} + {{macros.contact_us_self_hosted(support_email)}} + {% endif %} +

{% endblock %} diff --git a/templates/zerver/emails/followup_day1.html b/templates/zerver/emails/followup_day1.html index 169e7fbeda..bf92643a7d 100644 --- a/templates/zerver/emails/followup_day1.html +++ b/templates/zerver/emails/followup_day1.html @@ -53,7 +53,10 @@

- {% trans support_email=macros.email_tag(support_email) %}Questions? Contact -us any time at {{ support_email }}.{% endtrans %} + {% if corporate_enabled %} + {% trans %}Questions? Contact us — we'd love to help!{% endtrans %} + {% else %} + {{macros.contact_us_self_hosted(support_email)}} + {% endif %}

{% endblock %} diff --git a/templates/zerver/emails/invitation.html b/templates/zerver/emails/invitation.html index 09e40b7e8c..15979a5964 100644 --- a/templates/zerver/emails/invitation.html +++ b/templates/zerver/emails/invitation.html @@ -16,6 +16,10 @@ {{ _("Complete registration") }}

- {% 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 %} + {% if corporate_enabled %} + {{macros.contact_us_zulip_cloud(support_email)}} + {% else %} + {{macros.contact_us_self_hosted(support_email)}} + {% endif %}

{% endblock %} diff --git a/templates/zerver/emails/macros.html b/templates/zerver/emails/macros.html index 8b83e71c32..c1436ab320 100644 --- a/templates/zerver/emails/macros.html +++ b/templates/zerver/emails/macros.html @@ -9,3 +9,11 @@ {% macro link_tag(url, text) -%} {{ text | default(url) }} {%- endmacro %} + +{% macro contact_us_self_hosted(email) -%} + {% trans %}If you have any questions, please contact this Zulip server's administrators at {{ email }}.{% endtrans %} +{%- endmacro %} + +{% macro contact_us_zulip_cloud(email) -%} + {% trans %}Do you have questions or feedback to share? Contact us — we'd love to help!{% endtrans %} +{%- endmacro %} diff --git a/templates/zerver/emails/realm_reactivation.html b/templates/zerver/emails/realm_reactivation.html index c02d7fee9b..de44714a8b 100644 --- a/templates/zerver/emails/realm_reactivation.html +++ b/templates/zerver/emails/realm_reactivation.html @@ -16,5 +16,11 @@

{% trans %}If the request was in error, you can take no action and this link will expire in 24 hours.{% endtrans %}

-

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

+

+ {% if corporate_enabled %} + {{macros.contact_us_zulip_cloud(support_email)}} + {% else %} + {{macros.contact_us_self_hosted(support_email)}} + {% endif %} +

{% endblock %}