mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 14:08:47 -04:00
Now that we allow multiple SMS senders for a service, update the sender for SMS to be the default SMS sender, regardless if it is inbound number or not
This commit is contained in:
@@ -73,7 +73,7 @@ def send_sms_to_provider(notification):
|
||||
to=validate_and_format_phone_number(notification.to, international=notification.international),
|
||||
content=str(template),
|
||||
reference=str(notification.id),
|
||||
sender=service.get_inbound_number()
|
||||
sender=service.get_default_sms_sender()
|
||||
)
|
||||
except Exception as e:
|
||||
dao_toggle_sms_provider(provider.name)
|
||||
|
||||
@@ -275,8 +275,6 @@ class Service(db.Model, Versioned):
|
||||
def get_inbound_number(self):
|
||||
if self.inbound_number and self.inbound_number.active:
|
||||
return self.inbound_number.number
|
||||
else:
|
||||
return self.get_default_sms_sender()
|
||||
|
||||
def get_default_sms_sender(self):
|
||||
default_sms_sender = [x for x in self.service_sms_senders if x.is_default]
|
||||
|
||||
@@ -95,7 +95,7 @@ def post_notification(notification_type):
|
||||
if notification_type == SMS_TYPE:
|
||||
create_resp_partial = functools.partial(
|
||||
create_post_sms_response_from_notification,
|
||||
from_number=authenticated_service.get_inbound_number()
|
||||
from_number=authenticated_service.get_default_sms_sender()
|
||||
)
|
||||
elif notification_type == EMAIL_TYPE:
|
||||
create_resp_partial = functools.partial(
|
||||
|
||||
Reference in New Issue
Block a user