mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Send text message that are to an international number from a number rather than "Notify"
Update `send_user_2fa_code` to send from number when recipient is international Update `update_user_attribute` to send from number when recipient is international
This commit is contained in:
@@ -179,6 +179,7 @@ class Config(object):
|
||||
MOU_SIGNED_ON_BEHALF_SIGNER_RECEIPT_TEMPLATE_ID = 'c20206d5-bf03-4002-9a90-37d5032d9e84'
|
||||
MOU_SIGNED_ON_BEHALF_ON_BEHALF_RECEIPT_TEMPLATE_ID = '522b6657-5ca5-4368-a294-6b527703bd0b'
|
||||
MOU_NOTIFY_TEAM_ALERT_TEMPLATE_ID = 'd0e66c4c-0c50-43f0-94f5-f85b613202d4'
|
||||
NOTIFY_NUMBER_SMS_SENDER = '07984404008'
|
||||
|
||||
BROKER_URL = 'sqs://'
|
||||
BROKER_TRANSPORT_OPTIONS = {
|
||||
|
||||
@@ -4,6 +4,7 @@ from datetime import datetime
|
||||
from urllib.parse import urlencode
|
||||
|
||||
from flask import (jsonify, request, Blueprint, current_app, abort)
|
||||
from notifications_utils.recipients import is_uk_phone_number
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
from app.config import QueueNames
|
||||
@@ -104,7 +105,10 @@ def update_user_attribute(user_id):
|
||||
elif 'mobile_number' in update_dct:
|
||||
template = dao_get_template_by_id(current_app.config['TEAM_MEMBER_EDIT_MOBILE_TEMPLATE_ID'])
|
||||
recipient = user_to_update.mobile_number
|
||||
reply_to = template.service.get_default_sms_sender()
|
||||
if is_uk_phone_number(recipient):
|
||||
reply_to = template.service.get_default_sms_sender()
|
||||
else:
|
||||
reply_to = current_app.config['NOTIFY_NUMBER_SMS_SENDER']
|
||||
else:
|
||||
return jsonify(data=user_to_update.serialize()), 200
|
||||
service = Service.query.get(current_app.config['NOTIFY_SERVICE_ID'])
|
||||
@@ -267,7 +271,10 @@ def create_2fa_code(template_id, user_to_send_to, secret_code, recipient, person
|
||||
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()
|
||||
if is_uk_phone_number(recipient):
|
||||
reply_to = template.service.get_default_sms_sender()
|
||||
else:
|
||||
reply_to = current_app.config['NOTIFY_NUMBER_SMS_SENDER']
|
||||
elif template.template_type == EMAIL_TYPE:
|
||||
reply_to = template.service.get_default_reply_to_email_address()
|
||||
saved_notification = persist_notification(
|
||||
|
||||
Reference in New Issue
Block a user