mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-15 01:32:20 -05:00
Fix bug where sending messages failed
When building the template it was looking for a placeholder called ((phone number)). This caused it to fail because the template it had did not match the personalisation it was being given. `Template` has an optional parameter for specifying personalisation values that should be ignored. The recipient of a message is an example of such a value. This commit passes that extra parameter, which fixes that bug.
This commit is contained in:
@@ -69,7 +69,8 @@ def send_sms(service_id, notification_id, encrypted_notification, created_at):
|
||||
template = Template(
|
||||
dao_get_template_by_id(notification['template']).__dict__,
|
||||
values=notification.get('personalisation', {}),
|
||||
prefix=service.name
|
||||
prefix=service.name,
|
||||
drop_values={first_column_heading['sms']}
|
||||
)
|
||||
|
||||
client = firetext_client
|
||||
@@ -111,7 +112,8 @@ def send_email(service_id, notification_id, subject, from_address, encrypted_not
|
||||
notification = encryption.decrypt(encrypted_notification)
|
||||
template = Template(
|
||||
dao_get_template_by_id(notification['template']).__dict__,
|
||||
values=notification.get('personalisation', {})
|
||||
values=notification.get('personalisation', {}),
|
||||
drop_values={first_column_heading['email']}
|
||||
)
|
||||
|
||||
client = aws_ses_client
|
||||
|
||||
Reference in New Issue
Block a user