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.
This commit is contained in:
Ujjwal Aggarwal 2023-02-20 22:54:28 +05:30 committed by Tim Abbott
parent 98176ddb57
commit fc58c35c0b
5 changed files with 32 additions and 5 deletions

View File

@ -20,5 +20,11 @@
{% endif %} {% 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>
{% if corporate_enabled %}
{{macros.contact_us_zulip_cloud(support_email)}}
{% else %}
{{macros.contact_us_self_hosted(support_email)}}
{% endif %}
</p>
{% endblock %} {% endblock %}

View File

@ -53,7 +53,10 @@
</p> </p>
<p> <p>
{% trans support_email=macros.email_tag(support_email) %}Questions? Contact {% if corporate_enabled %}
us any time at {{ support_email }}.{% endtrans %} {% 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> </p>
{% endblock %} {% endblock %}

View File

@ -16,6 +16,10 @@
<a class="button" href="{{ activate_url }}">{{ _("Complete registration") }}</a> <a class="button" href="{{ activate_url }}">{{ _("Complete registration") }}</a>
</p> </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 %} {% if corporate_enabled %}
{{macros.contact_us_zulip_cloud(support_email)}}
{% else %}
{{macros.contact_us_self_hosted(support_email)}}
{% endif %}
</p> </p>
{% endblock %} {% endblock %}

View File

@ -9,3 +9,11 @@
{% macro link_tag(url, text) -%} {% macro link_tag(url, text) -%}
<a href="{{ url }}">{{ text | default(url) }}</a> <a href="{{ url }}">{{ text | default(url) }}</a>
{%- endmacro %} {%- endmacro %}
{% macro contact_us_self_hosted(email) -%}
{% trans %}If you have any questions, please contact this Zulip server's administrators at <a href="{{ email }}">{{ email }}</a>.{% endtrans %}
{%- endmacro %}
{% macro contact_us_zulip_cloud(email) -%}
{% trans %}Do you have questions or feedback to share? <a href="{{ email }}">Contact us</a> — we'd love to help!{% endtrans %}
{%- endmacro %}

View File

@ -16,5 +16,11 @@
<p>{% trans %}If the request was in error, you can take no action and this link will expire in 24 hours.{% endtrans %}</p> <p>{% trans %}If the request was in error, you can take no action and this link will expire in 24 hours.{% 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> <p>
{% if corporate_enabled %}
{{macros.contact_us_zulip_cloud(support_email)}}
{% else %}
{{macros.contact_us_self_hosted(support_email)}}
{% endif %}
</p>
{% endblock %} {% endblock %}