mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-18 08:02:31 -05:00
Add notification ID to SES bounce reason
At the moment we log everytime we get a bounce from SES, however we don't link it to a particular notification so it's hard to know for what sub reason a notifcation did not deliver by looking at the logs. This commit changes this by now looking the bounce reason after we have found the notification ID and including them together. So if you know search for a notification ID in Kibana, you will see full logs for why it failed to deliver.
This commit is contained in:
@@ -17,12 +17,11 @@ from app.config import QueueNames
|
||||
|
||||
def determine_notification_bounce_type(notification_type, ses_message):
|
||||
remove_emails_from_bounce(ses_message)
|
||||
current_app.logger.info('SES bounce dict: {}'.format(ses_message))
|
||||
if ses_message['bounce']['bounceType'] == 'Permanent':
|
||||
notification_type = ses_message['bounce']['bounceType'] # permanent or not
|
||||
else:
|
||||
notification_type = 'Temporary'
|
||||
return notification_type
|
||||
return notification_type, ses_message
|
||||
|
||||
|
||||
def handle_complaint(ses_message):
|
||||
|
||||
Reference in New Issue
Block a user