mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Merge pull request #1414 from GSA/notify-api-1385
add debugging for sender numbers
This commit is contained in:
@@ -63,12 +63,31 @@ class AwsSnsClient(SmsClient):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default_num = " ".join(self.current_app.config["AWS_US_TOLL_FREE_NUMBER"])
|
||||||
|
if isinstance(sender, str):
|
||||||
|
non_scrubbable = " ".join(sender)
|
||||||
|
|
||||||
|
self.current_app.logger.info(
|
||||||
|
f"notify-api-1385 sender {non_scrubbable} is a {type(sender)} default is a {type(default_num)}"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.current_app.logger.warning(
|
||||||
|
f"notify-api-1385 sender is type {type(sender)}!! {sender}"
|
||||||
|
)
|
||||||
if self._valid_sender_number(sender):
|
if self._valid_sender_number(sender):
|
||||||
|
self.current_app.logger.info(
|
||||||
|
f"notify-api-1385 use valid sender {non_scrubbable} instead of default {default_num}"
|
||||||
|
)
|
||||||
|
|
||||||
attributes["AWS.MM.SMS.OriginationNumber"] = {
|
attributes["AWS.MM.SMS.OriginationNumber"] = {
|
||||||
"DataType": "String",
|
"DataType": "String",
|
||||||
"StringValue": sender,
|
"StringValue": sender,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
|
self.current_app.logger.info(
|
||||||
|
f"notify-api-1385 use default {default_num} instead of invalid sender"
|
||||||
|
)
|
||||||
|
|
||||||
attributes["AWS.MM.SMS.OriginationNumber"] = {
|
attributes["AWS.MM.SMS.OriginationNumber"] = {
|
||||||
"DataType": "String",
|
"DataType": "String",
|
||||||
"StringValue": self.current_app.config["AWS_US_TOLL_FREE_NUMBER"],
|
"StringValue": self.current_app.config["AWS_US_TOLL_FREE_NUMBER"],
|
||||||
|
|||||||
Reference in New Issue
Block a user