mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Add a non-GOV.UK banner option for email branding
Added an extra name, 'org_banner', for branding types into branding_type table Added org banner into user model in database Added checks for new branding type to ensure that the correct data is passed into the dict Tested new checks in html email options
This commit is contained in:
@@ -19,6 +19,7 @@ from app.models import (
|
||||
SMS_TYPE,
|
||||
KEY_TYPE_TEST,
|
||||
BRANDING_ORG,
|
||||
BRANDING_ORG_BANNER,
|
||||
BRANDING_GOVUK,
|
||||
EMAIL_TYPE,
|
||||
NOTIFICATION_TECHNICAL_FAILURE,
|
||||
@@ -174,7 +175,8 @@ def get_logo_url(base_url, logo_file):
|
||||
|
||||
|
||||
def get_html_email_options(service):
|
||||
govuk_banner = service.branding != BRANDING_ORG
|
||||
govuk_banner = service.branding not in (BRANDING_ORG, BRANDING_ORG_BANNER)
|
||||
brand_banner = service.branding == BRANDING_ORG_BANNER
|
||||
if service.organisation and service.branding != BRANDING_GOVUK:
|
||||
logo_url = get_logo_url(
|
||||
current_app.config['ADMIN_BASE_URL'],
|
||||
@@ -189,7 +191,7 @@ def get_html_email_options(service):
|
||||
else:
|
||||
branding = {}
|
||||
|
||||
return dict(govuk_banner=govuk_banner, **branding)
|
||||
return dict(govuk_banner=govuk_banner, brand_banner=brand_banner, **branding)
|
||||
|
||||
|
||||
def technical_failure(notification):
|
||||
|
||||
Reference in New Issue
Block a user