Select sms sender or email reply to when creating a 2fa code notification

This commit is contained in:
Rebecca Law
2017-11-27 16:49:18 +00:00
parent 03c3ebbbe7
commit caf810eb76
2 changed files with 7 additions and 2 deletions

View File

@@ -214,7 +214,11 @@ def create_2fa_code(template_id, user_to_send_to, secret_code, recipient, person
# save the code in the VerifyCode table
create_user_code(user_to_send_to, secret_code, template.template_type)
reply_to = None
if template.template_type == SMS_TYPE:
reply_to = template.service.get_default_sms_sender()
elif template.template_type == EMAIL_TYPE:
reply_to = template.service.get_default_reply_to_email_address()
saved_notification = persist_notification(
template_id=template.id,
template_version=template.version,
@@ -224,7 +228,7 @@ def create_2fa_code(template_id, user_to_send_to, secret_code, recipient, person
notification_type=template.template_type,
api_key_id=None,
key_type=KEY_TYPE_NORMAL,
reply_to_text=template.service.get_default_sms_sender()
reply_to_text=reply_to
)
# Assume that we never want to observe the Notify service's research mode
# setting for this notification - we still need to be able to log into the