emails: Show preheader block only if preheader is present.

This commit is contained in:
Vishnu KS 2019-08-17 14:34:48 +05:30 committed by Tim Abbott
parent ff6dab6883
commit f32382f7b7
3 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Zulip</title> <title>Zulip</title>
</head> </head>
{% if has_preheader %}
<span style="display:none !important; <span style="display:none !important;
visibility:hidden; visibility:hidden;
color:transparent; color:transparent;
@ -19,6 +20,7 @@
overflow:hidden;"> overflow:hidden;">
{% block preheader %}{% endblock %} {% block preheader %}{% endblock %}
</span> </span>
{% endif %}
{% block content %}{% endblock %} {% block content %}{% endblock %}
{% block manage_preferences %}{% endblock %} {% block manage_preferences %}{% endblock %}
</html> </html>

View File

@ -26,4 +26,4 @@ LATEST_RELEASE_ANNOUNCEMENT = "https://blog.zulip.org/2019/03/01/zulip-2-0-relea
# historical commits sharing the same major version, in which case a # historical commits sharing the same major version, in which case a
# minor version bump suffices. # minor version bump suffices.
PROVISION_VERSION = '49.0' PROVISION_VERSION = '49.1'

View File

@ -202,6 +202,8 @@ def handle_digest_email(user_profile_id: int, cutoff: float,
context["new_streams"] = new_streams context["new_streams"] = new_streams
context["new_streams_count"] = new_streams_count context["new_streams_count"] = new_streams_count
# TODO: Set has_preheader if we want to include a preheader.
if render_to_web: if render_to_web:
return context return context