settings: Add setting to disable message content in missed message emails.

Fixes #6938.
This commit is contained in:
YJDave
2017-11-29 18:12:39 +05:30
committed by Tim Abbott
parent 382ac24151
commit c94b21e9ac
11 changed files with 127 additions and 27 deletions

View File

@@ -304,6 +304,7 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile,
'mention': missed_messages[0].is_stream_message(),
'unsubscribe_link': unsubscribe_link,
'realm_name_in_notifications': user_profile.realm_name_in_notifications,
'show_message_content': user_profile.message_content_in_email_notifications,
})
# If this setting (email mirroring integration) is enabled, only then
@@ -320,6 +321,12 @@ def do_send_missedmessage_events_reply_in_zulip(user_profile: UserProfile,
'reply_to_zulip': False,
})
# If there is no content in message, it's not clear what user would be replying to.
if not user_profile.message_content_in_email_notifications:
context.update({
'reply_to_zulip': False,
})
from zerver.lib.email_mirror import create_missed_message_address
reply_to_address = create_missed_message_address(user_profile, missed_messages[0])
if reply_to_address == FromAddress.NOREPLY: