mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-21 14:59:47 -04:00
Add page where users can say they want branding
At the moment branding is an undocumented feature. We get a bunch of support tickets from teams asking its possible. This commit: - lets people know it’s possible, and what the options are - is the first step towards making this process as self-service as possible In some cases we will be able to infer a user’s organisation from there email address, and Google image search their logo. So the experience for them is that they press a button and government just sorts it out for you (also known as "the dream"). In other cases we will have to get back to people asking for a copy of their logo, or to find out about their service, but this is what we have to do at the moment anyway.
This commit is contained in:
@@ -931,3 +931,23 @@ class LinkOrganisationsForm(StripWhitespaceForm):
|
||||
DataRequired()
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
branding_options = (
|
||||
('govuk', 'GOV.UK only'),
|
||||
('both', 'GOV.UK and logo'),
|
||||
('org', 'Your logo'),
|
||||
('org_banner', 'Your logo on a colour'),
|
||||
)
|
||||
branding_options_dict = dict(branding_options)
|
||||
|
||||
|
||||
class BrandingOptionsEmail(StripWhitespaceForm):
|
||||
|
||||
options = RadioField(
|
||||
'Branding options',
|
||||
choices=branding_options,
|
||||
validators=[
|
||||
DataRequired()
|
||||
],
|
||||
)
|
||||
|
||||
@@ -25,6 +25,7 @@ from app import (
|
||||
)
|
||||
from app.main import main
|
||||
from app.main.forms import (
|
||||
BrandingOptionsEmail,
|
||||
ConfirmPasswordForm,
|
||||
FreeSMSAllowance,
|
||||
InternationalSMSForm,
|
||||
@@ -41,6 +42,7 @@ from app.main.forms import (
|
||||
ServiceSmsSenderForm,
|
||||
ServiceSwitchLettersForm,
|
||||
SMSPrefixForm,
|
||||
branding_options_dict,
|
||||
)
|
||||
from app.utils import (
|
||||
AgreementInfo,
|
||||
@@ -884,6 +886,44 @@ def link_service_to_organisation(service_id):
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/branding-request/email", methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@user_has_permissions('manage_service')
|
||||
def branding_request(service_id):
|
||||
|
||||
form = BrandingOptionsEmail(
|
||||
options=current_service['branding']
|
||||
)
|
||||
|
||||
if form.validate_on_submit():
|
||||
zendesk_client.create_ticket(
|
||||
subject='Email branding request - {}'.format(current_service['name']),
|
||||
message=(
|
||||
'On behalf of {} ({})\n'
|
||||
'\n---'
|
||||
'\nBranding requested: {}'
|
||||
).format(
|
||||
current_service['name'],
|
||||
url_for('main.service_dashboard', service_id=current_service['id'], _external=True),
|
||||
branding_options_dict[form.options.data],
|
||||
),
|
||||
ticket_type=zendesk_client.TYPE_QUESTION,
|
||||
user_email=current_user.email_address,
|
||||
user_name=current_user.name,
|
||||
)
|
||||
|
||||
flash((
|
||||
'Thanks for your branding request. We’ll get back to you '
|
||||
'within one working day.'
|
||||
), 'default')
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
return render_template(
|
||||
'views/service-settings/branding/email-options.html',
|
||||
form=form,
|
||||
)
|
||||
|
||||
|
||||
def get_branding_as_value_and_label(email_branding):
|
||||
return [
|
||||
(branding['id'], branding['name'])
|
||||
|
||||
Reference in New Issue
Block a user