Update notification status by message reference

- SES sends a reference to allow us to identify the notification
- use this to update status

If source of email is one of our internal emails (invites or validations) - don't try and update a notification.
This commit is contained in:
Martyn Inglis
2016-03-11 10:19:40 +00:00
parent 901d04605f
commit 62a7b8bcd0
5 changed files with 92 additions and 35 deletions

View File

@@ -282,6 +282,7 @@ def sample_notification(notify_db,
job=None,
to_field=None,
status='sent',
reference=None,
created_at=datetime.utcnow()):
if service is None:
service = sample_service(notify_db, notify_db_session)
@@ -305,6 +306,7 @@ def sample_notification(notify_db,
'service': service,
'template': template,
'status': status,
'reference': reference,
'created_at': created_at
}
notification = Notification(**data)