Refactor send_sms and send_email to use common code to persist the notificaiton.

This commit is contained in:
Rebecca Law
2016-11-11 10:41:39 +00:00
parent abecb5ff98
commit eafbbd9809
4 changed files with 101 additions and 79 deletions

View File

@@ -40,7 +40,9 @@ def persist_notification(template_id,
personalisation,
notification_type,
api_key_id,
key_type):
key_type,
job_id=None,
job_row_number=None):
notification = Notification.from_v2_api_request(template_id=template_id,
template_version=template_version,
recipient=recipient,
@@ -48,7 +50,10 @@ def persist_notification(template_id,
personalisation=personalisation,
notification_type=notification_type,
api_key_id=api_key_id,
key_type=key_type)
key_type=key_type,
job_id=job_id,
job_row_number=job_row_number
)
dao_create_notification(notification)
return notification