Add redact_missing argument to get_template

Adds an interface to use:
https://github.com/alphagov/notifications-utils/pull/171
This commit is contained in:
Chris Hill-Scott
2017-06-24 17:18:49 +01:00
parent 9f20ea4b7e
commit 4798258e62
2 changed files with 8 additions and 4 deletions

View File

@@ -267,6 +267,7 @@ def get_template(
expand_emails=False,
letter_preview_url=None,
page_count=1,
redact_missing_personalisation=False,
):
if 'email' == template['template_type']:
return EmailPreviewTemplate(
@@ -274,14 +275,16 @@ def get_template(
from_name=service['name'],
from_address='{}@notifications.service.gov.uk'.format(service['email_from']),
expanded=expand_emails,
show_recipient=show_recipient
show_recipient=show_recipient,
redact_missing_personalisation=redact_missing_personalisation,
)
if 'sms' == template['template_type']:
return SMSPreviewTemplate(
template,
prefix=service['name'],
sender=(service['sms_sender'] not in {'GOVUK', None}),
show_recipient=show_recipient
show_recipient=show_recipient,
redact_missing_personalisation=redact_missing_personalisation,
)
if 'letter' == template['template_type']:
if letter_preview_url:
@@ -294,7 +297,8 @@ def get_template(
return LetterPreviewTemplate(
template,
contact_block=service['letter_contact_block'],
admin_base_url=current_app.config['ADMIN_BASE_URL']
admin_base_url=current_app.config['ADMIN_BASE_URL'],
redact_missing_personalisation=redact_missing_personalisation,
)

View File

@@ -28,4 +28,4 @@ notifications-python-client>=3.1,<3.2
awscli>=1.11,<1.12
awscli-cwlogs>=1.4,<1.5
git+https://github.com/alphagov/notifications-utils.git@17.3.2#egg=notifications-utils==17.3.2
git+https://github.com/alphagov/notifications-utils.git@17.5.0#egg=notifications-utils==17.5.0