Merge pull request #3498 from alphagov/add-broadcast-template

Allow adding broadcast templates
This commit is contained in:
Chris Hill-Scott
2020-07-06 09:06:16 +01:00
committed by GitHub
18 changed files with 285 additions and 87 deletions

View File

@@ -37,6 +37,7 @@ from notifications_utils.postal_address import PostalAddress
from notifications_utils.recipients import RecipientCSV
from notifications_utils.take import Take
from notifications_utils.template import (
BroadcastPreviewTemplate,
EmailPreviewTemplate,
LetterImageTemplate,
LetterPreviewTemplate,
@@ -451,6 +452,10 @@ def get_template(
admin_base_url=current_app.config['ADMIN_BASE_URL'],
redact_missing_personalisation=redact_missing_personalisation,
)
if 'broadcast' == template['template_type']:
return BroadcastPreviewTemplate(
template,
)
def get_current_financial_year():
@@ -475,10 +480,6 @@ def get_time_left(created_at, service_data_retention_days=7):
)
def email_or_sms_not_enabled(template_type, permissions):
return (template_type in ['email', 'sms']) and (template_type not in permissions)
def get_logo_cdn_domain():
parsed_uri = urlparse(current_app.config['ADMIN_BASE_URL'])