Remove email from the log message

This commit is contained in:
Rebecca Law
2018-05-30 16:45:18 +01:00
parent 621c81a9d8
commit 23e6b57c26
2 changed files with 13 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ def process_ses_response(ses_request):
if notification_type == 'Bounce':
notification_type = determine_notification_bounce_type(notification_type, ses_message)
elif notification_type == 'Complaint':
remove_emails_from_complaint(ses_message)
current_app.logger.info("Complaint from SES: \n{}".format(ses_message))
return
@@ -105,6 +106,10 @@ def remove_emails_from_bounce(bounce_dict):
recip.pop('emailAddress')
def remove_emails_from_complaint(complaint_dict):
complaint_dict['complaint'].pop('complainedRecipients')
def _check_and_queue_callback_task(notification):
# queue callback task only if the service_callback_api exists
service_callback_api = get_service_callback_api_for_service(service_id=notification.service_id)