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

@@ -16,7 +16,8 @@ from app.config import QueueNames
from app.models import SMS_TYPE, Notification, KEY_TYPE_TEST, EMAIL_TYPE, NOTIFICATION_CREATED, ScheduledNotification
from app.dao.notifications_dao import (dao_create_notification,
dao_delete_notifications_and_history_by_id,
dao_created_scheduled_notification)
dao_created_scheduled_notification,
dao_create_notification_email_reply_to_mapping)
from app.v2.errors import BadRequestError
from app.utils import get_template_instance, cache_key_for_service_template_counter, convert_bst_to_utc
@@ -141,3 +142,7 @@ def persist_scheduled_notification(notification_id, scheduled_for):
scheduled_notification = ScheduledNotification(notification_id=notification_id,
scheduled_for=scheduled_datetime)
dao_created_scheduled_notification(scheduled_notification)
def persist_email_reply_to_id_for_notification(notification_id, email_reply_to_id):
dao_create_notification_email_reply_to_mapping(notification_id, email_reply_to_id)