mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Update template content values from notification personalisation
We need to set template_with_content placeholder values with an updated personalisation dictionary after processing the document uploads in order to avoid returning base64 file data instead of the document URLs in the response contents.
This commit is contained in:
@@ -138,7 +138,7 @@ def post_notification(notification_type):
|
||||
reply_to_text=reply_to
|
||||
)
|
||||
else:
|
||||
notification, personalisation = process_sms_or_email_notification(
|
||||
notification = process_sms_or_email_notification(
|
||||
form=form,
|
||||
notification_type=notification_type,
|
||||
api_key=api_user,
|
||||
@@ -147,7 +147,7 @@ def post_notification(notification_type):
|
||||
reply_to_text=reply_to
|
||||
)
|
||||
|
||||
template_with_content.values = personalisation
|
||||
template_with_content.values = notification.personalisation
|
||||
|
||||
if notification_type == SMS_TYPE:
|
||||
create_resp_partial = functools.partial(
|
||||
@@ -216,7 +216,7 @@ def process_sms_or_email_notification(*, form, notification_type, api_key, templ
|
||||
else:
|
||||
current_app.logger.debug("POST simulated notification for id: {}".format(notification.id))
|
||||
|
||||
return notification, personalisation
|
||||
return notification
|
||||
|
||||
|
||||
def process_document_uploads(personalisation_data, service, simulated=False):
|
||||
|
||||
Reference in New Issue
Block a user