mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
Use NOREPLY_EMAIL_ADDRESS if email gateway not enabled.
This fixes a regression where missed message emails would not be sent at all in the event that EMAIL_GATEWAY_PATTERN was unset. The overall experience still isn't great, but it's better than crashing. Fixes: #1411 [commit message expanded by tabbott]
This commit is contained in:
@@ -88,6 +88,11 @@ def get_missed_message_token_from_address(address):
|
||||
|
||||
def create_missed_message_address(user_profile, message):
|
||||
# type: (UserProfile, Message) -> text_type
|
||||
if settings.EMAIL_GATEWAY_PATTERN == '':
|
||||
logging.warning("EMAIL_GATEWAY_PATTERN is an empty string, using "
|
||||
"NOREPLY_EMAIL_ADDRESS in the 'from' field.")
|
||||
return settings.NOREPLY_EMAIL_ADDRESS
|
||||
|
||||
if message.recipient.type == Recipient.PERSONAL:
|
||||
# We need to reply to the sender so look up their personal recipient_id
|
||||
recipient_id = get_recipient(Recipient.PERSONAL, message.sender_id).id
|
||||
|
||||
Reference in New Issue
Block a user