Use Zendesk form for branding requests

This changes the Zendesk tickets created when an email or letter
branding request is submitted to use the new Zendesk Form that was
introduced in https://github.com/alphagov/notifications-utils/pull/899
This commit is contained in:
Katie Smith
2021-09-24 09:24:13 +01:00
parent c76cd82a97
commit e9948a0234
2 changed files with 42 additions and 22 deletions

View File

@@ -1207,8 +1207,8 @@ def branding_request(service_id, branding_type):
elif branding_type == "letter":
branding_name = current_service.letter_branding_name
if form.validate_on_submit():
zendesk_client.create_ticket(
subject='{} branding request - {}'.format(branding_type.capitalize(), current_service.name),
ticket = NotifySupportTicket(
subject=f'{branding_type.capitalize()} branding request - {current_service.name}',
message=(
'Organisation: {organisation}\n'
'Service: {service_name}\n'
@@ -1228,11 +1228,14 @@ def branding_request(service_id, branding_type):
new_paragraph='\n\n' if form.something_else.data else '',
detail=form.something_else.data or ''
),
ticket_type=zendesk_client.TYPE_QUESTION,
user_email=current_user.email_address,
ticket_type=NotifySupportTicket.TYPE_QUESTION,
user_name=current_user.name,
tags=['notify_action', 'notify_branding'],
user_email=current_user.email_address,
org_id=current_service.organisation_id,
org_type=current_service.organisation_type,
service_id=current_service.id
)
zendesk_client.send_ticket_to_zendesk(ticket)
flash((
'Thanks for your branding request. Well get back to you '
'within one working day.'