Use personalisation to set client_reference for letters

which were sent through Notify interface only. This is done
to avoid performance dip from additional operation for
other notification types.
This commit is contained in:
Pea Tyczynska
2021-03-19 16:42:55 +00:00
parent a2da8bc070
commit 52c529ab3a
9 changed files with 79 additions and 49 deletions

View File

@@ -108,6 +108,7 @@ def send_notification(notification_type):
if notification_type == SMS_TYPE:
check_if_service_can_send_to_number(authenticated_service, notification_form['to'])
# 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,
@@ -120,7 +121,7 @@ def send_notification(notification_type):
api_key_id=api_user.id,
key_type=api_user.key_type,
simulated=simulated,
reply_to_text=template.reply_to_text
reply_to_text=template.reply_to_text,
)
if not simulated:
queue_name = QueueNames.PRIORITY if template.process_type == PRIORITY else None