From be762f9485def0a3422e1ef8afcb671d513a744f Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Wed, 1 May 2019 09:38:05 +0530 Subject: [PATCH] digest: Strip down the digest email removing a lot of fluff. --- templates/zerver/emails/digest.source.html | 63 +--------------------- templates/zerver/emails/digest.txt | 43 ++------------- version.py | 2 +- zerver/tests/test_digest.py | 2 +- 4 files changed, 8 insertions(+), 102 deletions(-) diff --git a/templates/zerver/emails/digest.source.html b/templates/zerver/emails/digest.source.html index fa30030939..b211f26497 100644 --- a/templates/zerver/emails/digest.source.html +++ b/templates/zerver/emails/digest.source.html @@ -1,44 +1,7 @@ {% extends "zerver/emails/email_base_messages.html" %} {% block content %} -

Hello {{ user_name }},

- -

A lot has happened on Zulip while you've been away! Visit Zulip to catch up.

- - {% if unread_pms %} -

Missed private messages

-

You have some missed private messages. Here are some of them:

-
- {% for recipient_block in unread_pms %} -
-
{{ recipient_block.header.html|safe }}
-
- {% for sender_block in recipient_block.senders %} - {% if sender_block.sender %}
{{ sender_block.sender }}
{% endif %} - {% for message_block in sender_block.content %} -
- {{ message_block.html|safe }} -
- {% endfor %} - {% endfor %} -
-
- {% endfor %} - - {% if remaining_unread_pms_count > 0 %}

+ {{ remaining_unread_pms_count }} more new private message{{ remaining_unread_pms_count|pluralize }}

-

Catch up on the rest of your PMs.

- {% endif %} -
- {% endif %} - - {% if hot_conversations %} -
-

Hot conversations

-

- Here are some of the hot conversations that have happened while you've been gone: -

- {% for convo in hot_conversations %}
{% for recipient_block in convo.first_few_messages %} @@ -59,39 +22,17 @@ {% endfor %}
{% endfor %} -

Catch up on the rest of these conversations.

- - {% endif %} - - {% if new_users and new_streams.html %} -
-

Group updates

- {% elif new_users %} -
-

New users

- {% elif new_streams.html %} -
-

New streams

{% endif %} {% if new_streams.html %} -

{% if new_stream_count and new_stream_count > 1 %}A new stream was{% else %}Some new streams were{% endif %} created:

+

New streams

-

{{ new_streams.html|display_list(4)|safe }}.

- -

Click on {% if new_stream_count and new_stream_count > 1 %}a{% else %}the{% endif %} name to check out some of the traffic, or visit your Streams page to subscribe.

- {% endif %} - - {% if new_users %} -

{% if new_streams.html or unread_pms or hot_conversations %}And finally, please{% else %}Please{% endif %} welcome {{ new_users|display_list(4) }} to Zulip!

+

{{ new_streams.html|display_list(1000)|safe }}.

{% endif %}

Click here to log in to Zulip and catch up.

- -

Cheers,
- The Zulip Team

{% endblock %} {% block manage_preferences %} diff --git a/templates/zerver/emails/digest.txt b/templates/zerver/emails/digest.txt index 46d45904a0..f3ed588a97 100644 --- a/templates/zerver/emails/digest.txt +++ b/templates/zerver/emails/digest.txt @@ -1,52 +1,17 @@ -Hello {{ user_name }}, - -A lot has happened on Zulip while you've been away! Visit -{{ realm_uri }} to catch up. - -{% if unread_pms %} -** Missed private messages ** - -You have some missed private messages. Here are some of them: - -{% for recipient_block in unread_pms %}{{ recipient_block.header.plain }} -{% for sender_block in recipient_block.senders %}{% if sender_block.sender %}{{ sender_block.sender }}{% endif %} -{% for message_block in sender_block.content %}{{ message_block.plain }} -{% endfor %} -{% endfor %}{% endfor %} -{% if remaining_unread_pms_count > 0 %}+ {{ remaining_unread_pms_count }} more new private message{{ remaining_unread_pms_count|pluralize }} -Catch up on the rest of your PMs: {{ realm_uri }}/#narrow/is/private{% endif %}{% endif %} - {% if hot_conversations %} -** Hot conversations ** - -Here are some of the hot conversations that have happened while you've -been gone: - {% for convo in hot_conversations %}{% for recipient_block in convo.first_few_messages %}{{ recipient_block.header.plain }} {% for sender_block in recipient_block.senders %}{% if sender_block.sender %}{{ sender_block.sender }} {% endif %} {% for message_block in sender_block.content %}{{ message_block.plain }} {% endfor %}{% endfor %} -{% if convo.count > 0 %}+ {{ convo.count }} more message{{ convo.count|pluralize }} by {{ convo.participants|display_list(4) }}.{% endif %} -{% endfor %}{% endfor %} -Catch up on the rest of these conversations: {{ realm_uri }}.{% endif %} +{% if convo.count > 0 %}+ {{ convo.count }} more message{{ convo.count|pluralize }} by {{ convo.participants|display_list(4) }}.{% endif %}{% endfor %}{% endfor %}{% endif %} - -{% if new_users and new_streams.plain %}** Group updates **{% elif new_users %}** New users **{% elif new_streams.plain %}** New streams **{% endif %} - -{% if new_streams.plain %}{% if new_stream_count and new_stream_count > 1 %}A new stream was{% else %}Some new streams were{% endif %} created: - - {{ new_streams.plain|display_list(4) }}. - -Visit your Streams page to subscribe: {{ realm_uri }}/#streams.{% endif %} - -{% if new_users %}{% if new_streams.plain or unread_pms or hot_conversations %}And finally, please{% else %}Please{% endif %} welcome {{ new_users|display_list(4) }} to Zulip!{% endif %} +{% if new_streams.plain %}** New streams ** + {{ new_streams.plain|display_list(1000) }}. +{% endif %} Click here to log in to Zulip and catch up: {{ realm_uri }}. -Cheers, -The Zulip Team - -- Manage email preferences: diff --git a/version.py b/version.py index b7d8838b59..52905eb27a 100644 --- a/version.py +++ b/version.py @@ -11,4 +11,4 @@ LATEST_RELEASE_ANNOUNCEMENT = "https://blog.zulip.org/2019/03/01/zulip-2-0-relea # Typically, adding a dependency only requires a minor version bump, and # removing a dependency requires a major version bump. -PROVISION_VERSION = '31.0' +PROVISION_VERSION = '31.1' diff --git a/zerver/tests/test_digest.py b/zerver/tests/test_digest.py index b0b07ad930..234b9341f9 100644 --- a/zerver/tests/test_digest.py +++ b/zerver/tests/test_digest.py @@ -275,4 +275,4 @@ class TestDigestContentInBrowser(ZulipTestCase): def test_get_digest_content_in_browser(self) -> None: self.login(self.example_email('hamlet')) result = self.client_get("/digest/") - self.assert_in_success_response(["A lot has happened on Zulip while you've been away!"], result) + self.assert_in_success_response(["Click here to log in to Zulip and catch up."], result)