mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Merge pull request #3498 from alphagov/add-broadcast-template
Allow adding broadcast templates
This commit is contained in:
@@ -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'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user