Added the mapping between notification and reply to email to the database and persisted the mapping when the request is received by the end point. the end point also checks if the reply to email id exists and if not returns an error. Also added tests to test the functionality.

This commit is contained in:
Richard Chapman
2017-10-05 11:33:20 +01:00
parent 68d8999b1c
commit d2168b7985
7 changed files with 171 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ from app.notifications.process_notifications import (
persist_notification,
send_notification_to_queue,
simulated_recipient,
persist_scheduled_notification)
persist_scheduled_notification, persist_email_reply_to_id_for_notification)
from app.notifications.process_letter_notifications import (
create_letter_notification
)
@@ -140,6 +140,10 @@ def process_sms_or_email_notification(*, form, notification_type, api_key, templ
simulated=simulated
)
email_reply_to_id = form.get("email_reply_to_id", None)
if email_reply_to_id is not None:
persist_email_reply_to_id_for_notification(notification.id, email_reply_to_id)
scheduled_for = form.get("scheduled_for", None)
if scheduled_for:
persist_scheduled_notification(notification.id, form["scheduled_for"])