mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
emails: Use macros for email tags in invitation email.
This commit is contained in:
@@ -50,7 +50,7 @@ def inline_template(template_source_name: str) -> None:
|
|||||||
# template, since we'll end up with 2 copipes of those tags.
|
# template, since we'll end up with 2 copipes of those tags.
|
||||||
# Thus, we strip this stuff out if the template extends
|
# Thus, we strip this stuff out if the template extends
|
||||||
# another template.
|
# another template.
|
||||||
if template_name != 'email_base_default':
|
if template_name not in ['email_base_default', 'macros']:
|
||||||
output = strip_unnecesary_tags(output)
|
output = strip_unnecesary_tags(output)
|
||||||
|
|
||||||
if ('zerver/emails/compiled/email_base_default.html' in output or
|
if ('zerver/emails/compiled/email_base_default.html' in output or
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{% import 'zerver/emails/compiled/macros.html' as macros %}
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|||||||
@@ -5,16 +5,17 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<p>{{ _("Hi there,") }}</p>
|
<p>{{ _("Hi there,") }}</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{% trans %}<a href="mailto:{{ referrer_email }}">{{ referrer_full_name }} ({{ referrer_email }})</a> wants you to join them on Zulip — the team communication tool designed for productivity.{% endtrans %}
|
{% trans referrer_name=macros.referrer_email_tag(referrer_email, referrer_full_name) %}{{ referrer_name }} wants you to join them on Zulip — the team communication tool designed for productivity.{% endtrans %}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{{ _("To get started, click the button below.") }}
|
{{ _("To get started, click the button below.") }}
|
||||||
<a class="button" href="{{ activate_url }}">{{ _("Complete registration") }}</a>
|
<a class="button" href="{{ activate_url }}">{{ _("Complete registration") }}</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{% trans %}Contact us any time at <a href="mailto:{{ support_email }}">{{ support_email }}</a> if you run into trouble, have any feedback, or just want to chat!{% 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 %}
|
||||||
</p>
|
</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
7
templates/zerver/emails/macros.source.html
Normal file
7
templates/zerver/emails/macros.source.html
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{% macro email_tag(email, text) -%}
|
||||||
|
<a href="mailto:{{ email }}">{{ text | default(email) }}</a>
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{% macro referrer_email_tag(referrer_email, referrer_name) -%}
|
||||||
|
<a href="mailto:{{ referrer_email }}">{{ referrer_name }} ({{ referrer_email }})</a>
|
||||||
|
{%- endmacro %}
|
||||||
Reference in New Issue
Block a user