Merge pull request #769 from alphagov/add-log-to-ses-callback

Added logging when the SES callback is successful.
This commit is contained in:
Rebecca Law
2016-12-16 11:58:43 +00:00
committed by GitHub

View File

@@ -87,12 +87,17 @@ def process_ses_response():
if not aws_response_dict['success']:
current_app.logger.info(
"SES delivery failed: notification {} has error found. Status {}".format(
"SES delivery failed: notification id {} and reference {} has error found. Status {}".format(
notification.id,
reference,
aws_response_dict['message']
)
)
else:
current_app.logger.info('{} callback return status of {} for notification: {}'.format(
client_name,
notification_status,
notification.id))
statsd_client.incr('callback.ses.{}'.format(notification_status))
if notification.sent_at:
statsd_client.timing_with_dates(