Update invite user endpoint to set the reply_to_text on the notification.

Update v1 post notifications to set the reply_to_text on the notification.
This commit is contained in:
Rebecca Law
2017-11-27 12:30:50 +00:00
parent 12024e9619
commit 530f2e7f6a
5 changed files with 69 additions and 13 deletions

View File

@@ -119,7 +119,7 @@ def send_notification(notification_type):
if notification_type == SMS_TYPE:
_service_can_send_internationally(authenticated_service, notification_form['to'])
reply_to = get_reply_to_text(notification_type)
# Do not persist or send notification to the queue if it is a simulated recipient
simulated = simulated_recipient(notification_form['to'], notification_type)
notification_model = persist_notification(template_id=template.id,
@@ -130,7 +130,9 @@ def send_notification(notification_type):
notification_type=notification_type,
api_key_id=api_user.id,
key_type=api_user.key_type,
simulated=simulated)
simulated=simulated,
reply_to_text=reply_to
)
if not simulated:
queue_name = QueueNames.PRIORITY if template.process_type == PRIORITY else None
send_notification_to_queue(notification=notification_model,
@@ -148,6 +150,16 @@ def send_notification(notification_type):
), 201
def get_reply_to_text(notification_type):
if notification_type == EMAIL_TYPE:
return authenticated_service.get_default_reply_to_email_address()
if notification_type == SMS_TYPE:
return authenticated_service.get_default_sms_sender()
if notification_type == LETTER_TYPE:
return authenticated_service.get_default_letter_contact()
def get_notification_return_data(notification_id, notification, template):
output = {
'body': str(template),