mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Use sms sender or reply to email address of the Notify service in create_2fa_code depending on message type.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user