emails: Improve the reply wording in missed_message emails.

This cleans up the reply_warning feature in favor of a more coherent
explanation of whether or not one can reply.

(Also, critically, it now advertises the ability to enable
missed-message email replies with some administrative configuration
work.)
This commit is contained in:
Vishnu Ks
2019-06-18 12:15:23 +00:00
committed by Tim Abbott
parent f67c85892b
commit 3a6cc4214f
4 changed files with 31 additions and 31 deletions

View File

@@ -324,12 +324,10 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile,
# ensure to display warning in the template.
if settings.EMAIL_GATEWAY_PATTERN:
context.update({
'reply_warning': False,
'reply_to_zulip': True,
})
else:
context.update({
'reply_warning': True,
'reply_to_zulip': False,
})
@@ -340,6 +338,11 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile,
else:
reply_to_name = "Zulip"
narrow_url = get_narrow_url(user_profile, missed_messages[0]['message'])
context.update({
'narrow_url': narrow_url,
})
senders = list(set(m['message'].sender for m in missed_messages))
if (missed_messages[0]['message'].recipient.type == Recipient.HUDDLE):
display_recipient = get_display_recipient(missed_messages[0]['message'].recipient)
@@ -399,7 +402,6 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile,
sender = senders[0]
from_name, from_address = (sender.full_name, sender.email)
context.update({
'reply_warning': False,
'reply_to_zulip': False,
})