Use Zendesk form for general enquiries

This commit is contained in:
Katie Smith
2021-09-24 11:09:28 +01:00
parent e9948a0234
commit 437af32d82
2 changed files with 55 additions and 19 deletions

View File

@@ -4,6 +4,9 @@ import pytz
from flask import redirect, render_template, request, session, url_for
from flask_login import current_user
from govuk_bank_holidays.bank_holidays import BankHolidays
from notifications_utils.clients.zendesk.zendesk_client import (
NotifySupportTicket,
)
from app import convert_to_boolean, current_service
from app.extensions import zendesk_client
@@ -124,14 +127,19 @@ def feedback(ticket_type):
service_string,
)
zendesk_client.create_ticket(
ticket = NotifySupportTicket(
subject='Notify feedback',
message=feedback_msg,
ticket_type=ticket_type,
p1=out_of_hours_emergency,
user_name=user_name,
user_email=user_email,
user_name=user_name
org_id=current_service.organisation_id if current_service else None,
org_type=current_service.organisation_type if current_service else None,
service_id=current_service.id if current_service else None,
)
zendesk_client.send_ticket_to_zendesk(ticket)
return redirect(url_for(
'.thanks',
out_of_hours_emergency=out_of_hours_emergency,