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">
<title>Zulip</title>
</head>
{% if has_preheader %}
<span style="display:none !important;
visibility:hidden;
color:transparent;
@ -19,6 +20,7 @@
overflow:hidden;">
{% block preheader %}{% endblock %}
</span>
{% endif %}
{% block content %}{% endblock %}
{% block manage_preferences %}{% endblock %}
</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
# 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_count"] = new_streams_count
# TODO: Set has_preheader if we want to include a preheader.
if render_to_web:
return context