mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Update limit to message_limit.
Further db changes and updates. Remove traceback print out. Fix bug in passing template id to a task.
This commit is contained in:
@@ -8,7 +8,7 @@ ses_response_map = {
|
||||
'Bounce': {
|
||||
"message": 'Bounced',
|
||||
"success": False,
|
||||
"notification_status": 'bounce',
|
||||
"notification_status": 'failed',
|
||||
"notification_statistics_status": STATISTICS_FAILURE
|
||||
},
|
||||
'Delivery': {
|
||||
@@ -19,9 +19,9 @@ ses_response_map = {
|
||||
},
|
||||
'Complaint': {
|
||||
"message": 'Complaint',
|
||||
"success": False,
|
||||
"notification_status": 'complaint',
|
||||
"notification_statistics_status": STATISTICS_FAILURE
|
||||
"success": True,
|
||||
"notification_status": 'delivered',
|
||||
"notification_statistics_status": STATISTICS_DELIVERED
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ firetext_responses = {
|
||||
},
|
||||
'2': {
|
||||
"message": 'Undelivered (Pending with Network)',
|
||||
"success": False,
|
||||
"notification_statistics_status": None,
|
||||
"notification_status": 'sent'
|
||||
"success": True,
|
||||
"notification_statistics_status": STATISTICS_DELIVERED,
|
||||
"notification_status": 'delivered'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,10 @@ class TwilioClient(SmsClient):
|
||||
def status(self, message_id):
|
||||
try:
|
||||
response = self.client.messages.get(message_id)
|
||||
if response.status in ('delivered', 'undelivered', 'failed'):
|
||||
if response.status in ('delivered', 'failed'):
|
||||
return response.status
|
||||
elif response.status == 'undelivered':
|
||||
return 'sending'
|
||||
return None
|
||||
except TwilioRestException as e:
|
||||
current_app.logger.exception(e)
|
||||
|
||||
Reference in New Issue
Block a user