mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-15 15:11:01 -05:00
Set reply_to_text for letter notifications posted to /notifications/letter
This commit is contained in:
@@ -3,7 +3,7 @@ from app.models import LETTER_TYPE
|
||||
from app.notifications.process_notifications import persist_notification
|
||||
|
||||
|
||||
def create_letter_notification(letter_data, template, api_key, status):
|
||||
def create_letter_notification(letter_data, template, api_key, status, reply_to_text=None):
|
||||
notification = persist_notification(
|
||||
template_id=template.id,
|
||||
template_version=template.version,
|
||||
@@ -18,6 +18,7 @@ def create_letter_notification(letter_data, template, api_key, status):
|
||||
job_row_number=None,
|
||||
reference=create_random_identifier(),
|
||||
client_reference=letter_data.get('reference'),
|
||||
status=status
|
||||
status=status,
|
||||
reply_to_text=reply_to_text
|
||||
)
|
||||
return notification
|
||||
|
||||
@@ -183,8 +183,12 @@ def process_letter_notification(*, letter_data, api_key, template):
|
||||
|
||||
# if we don't want to actually send the letter, then start it off in SENDING so we don't pick it up
|
||||
status = NOTIFICATION_CREATED if should_send else NOTIFICATION_SENDING
|
||||
|
||||
notification = create_letter_notification(letter_data, template, api_key, status=status)
|
||||
letter_contact_block = api_key.service.get_default_letter_contact()
|
||||
notification = create_letter_notification(letter_data=letter_data,
|
||||
template=template,
|
||||
api_key=api_key,
|
||||
status=status,
|
||||
reply_to_text=letter_contact_block)
|
||||
|
||||
if not should_send:
|
||||
update_letter_notifications_to_sent_to_dvla.apply_async(
|
||||
|
||||
Reference in New Issue
Block a user