From 219d5b998f244406b38a200c4fd9a4a282e09698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Tue, 8 Feb 2022 22:04:25 +0100 Subject: [PATCH 01/14] Add a suport form to create tickets in zendesk --- app/dashboard/__init__.py | 1 + app/dashboard/views/support.py | 57 ++++++++++++++++++++ templates/dashboard/support.html | 90 ++++++++++++++++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 app/dashboard/views/support.py create mode 100644 templates/dashboard/support.html diff --git a/app/dashboard/__init__.py b/app/dashboard/__init__.py index 875b203a..a1c50611 100644 --- a/app/dashboard/__init__.py +++ b/app/dashboard/__init__.py @@ -31,4 +31,5 @@ from .views import ( app, delete_account, notification, + support, ) diff --git a/app/dashboard/views/support.py b/app/dashboard/views/support.py new file mode 100644 index 00000000..565cfabc --- /dev/null +++ b/app/dashboard/views/support.py @@ -0,0 +1,57 @@ +import json + +import requests +from flask import render_template, request, flash, url_for, redirect +from flask_login import login_required, current_user +from app.dashboard.base import dashboard_bp +from app.db import Session +from app.log import LOG +from app.models import Alias, Mailbox + + +@dashboard_bp.route("/support", methods=["GET"]) +@login_required +def show_support_dialog(): + return render_template( "dashboard/support.html" ) + + +def createZendeskTicket(email: str, contents: str): + data = { + 'request': { + 'subject': 'Ticket created for user {}'.format(current_user.id), + 'comment': { + 'type': 'Comment', + 'body': contents + }, + 'requester': { + 'name': "SimpleLogin user {}".format(current_user.id), + 'email': email + } + } + } + url = 'https://simplelogin.zendesk.com/api/v2/requests.json' + headers = {'content-type': 'application/json'} + r = requests.post(url, data=json.dumps(data), headers=headers) + if r.status_code != 201: + if r.status_code == 401 or 422: + LOG.debug('Could not authenticate') + else: + LOG.debug('Problem with the request. Status ' + str(r.status_code)) + else: + flash("Ticket was created. You should receive an email notification", "success") + LOG.debug('Ticket created') + + +@dashboard_bp.route("/support", methods=["POST"]) +@login_required +def process_support_dialog(): + contents = request.form.get("ticketContents") or "" + email = request.form.get("ticketEmail") or "" + if not contents: + flash("Please add a description", "warning") + return render_template("dashboard/support.html", ticketEmail=email) + if not email: + flash("Please add an email", "warning") + return render_template("dashboard/support.html", ticketContents=contents) + createZendeskTicket(email, contents) + return redirect(url_for('dashboard.index')) diff --git a/templates/dashboard/support.html b/templates/dashboard/support.html new file mode 100644 index 00000000..22826dfe --- /dev/null +++ b/templates/dashboard/support.html @@ -0,0 +1,90 @@ +{% extends 'default.html' %} + +{% set active_page = None %} + +{% block title %} + Support +{% endblock %} + +{% block head %} + + + + +{% endblock %} + +{% block default_content %} + +
+ +
+
+
Report a problem
+
+ If an email cannot be delivered to your mailbox, please check your notifications for error messages +
+
+ A support ticket will be created in Zendesk. Please do not include any sensitive information in the ticket. +
+
+
+ + +
+
+ Attach files to support request +
+
+ + +
+
+ Where can we reach you? +
+
+ Conversations related to this ticket will be sent to this address. Feel free to use an alias here. +
+
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+ +{% endblock %} + + + From e57dcac2d23488a72f58503df74b2377f88b8c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Wed, 9 Feb 2022 12:00:48 +0100 Subject: [PATCH 02/14] Added zendesk submission flow --- app/config.py | 2 + app/dashboard/views/support.py | 58 +++++++++++++++---- templates/dashboard/support.html | 19 ++++-- .../dashboard/support_ticket_created.html | 37 ++++++++++++ templates/footer.html | 1 + 5 files changed, 102 insertions(+), 15 deletions(-) create mode 100644 templates/dashboard/support_ticket_created.html diff --git a/app/config.py b/app/config.py index bf773783..7bfb6433 100644 --- a/app/config.py +++ b/app/config.py @@ -412,3 +412,5 @@ PHONE_PROVIDER_1_SECRET = os.environ.get("PHONE_PROVIDER_1_SECRET") PHONE_PROVIDER_2_HEADER = os.environ.get("PHONE_PROVIDER_2_HEADER") PHONE_PROVIDER_2_SECRET = os.environ.get("PHONE_PROVIDER_2_SECRET") + +ZENDESK_HOST=os.environ.get('ZENDESK_HOST', 'noone.zendesk.com') diff --git a/app/dashboard/views/support.py b/app/dashboard/views/support.py index 565cfabc..d59932ec 100644 --- a/app/dashboard/views/support.py +++ b/app/dashboard/views/support.py @@ -1,27 +1,60 @@ import json +import urllib.parse +from typing import Union import requests from flask import render_template, request, flash, url_for, redirect from flask_login import login_required, current_user +from werkzeug.datastructures import FileStorage + from app.dashboard.base import dashboard_bp -from app.db import Session from app.log import LOG -from app.models import Alias, Mailbox +from app.models import Mailbox +from app.config import ZENDESK_HOST + +VALID_MIME_TYPES = ['text/plain', 'message/rfc822'] @dashboard_bp.route("/support", methods=["GET"]) @login_required def show_support_dialog(): - return render_template( "dashboard/support.html" ) + mailbox = Mailbox.get(current_user.default_mailbox_id) + return render_template("dashboard/support.html", ticketEmail=mailbox.email) -def createZendeskTicket(email: str, contents: str): +def upload_file_to_zendesk(file: FileStorage) -> Union[None, str]: + if file.mimetype not in VALID_MIME_TYPES and not file.mimetype.startswith('image/'): + flash('File {} is not an image, text or an email'.format(file.filename), "warning") + return None + escaped_filename = urllib.parse.urlencode({'filename': file.filename}) + url = 'https://{}/api/v2/uploads?{}'.format(ZENDESK_HOST, escaped_filename) + headers = {'content-type': file.mimetype} + response = requests.post(url, headers=headers, data=file.stream) + if response.status_code != 201: + if response.status_code == 401 or 422: + LOG.debug('Could not authenticate') + return None + else: + LOG.debug('Problem with the request. Status ' + str(response.status_code)) + return None + data = response.json() + return data['upload']['token'] + + +def create_zendesk_request(email: str, contents: str, files: [FileStorage]) -> bool: + tokens = [] + for file in files: + token = upload_file_to_zendesk(file) + if token is None: + return False + tokens.append(token) data = { 'request': { 'subject': 'Ticket created for user {}'.format(current_user.id), 'comment': { 'type': 'Comment', - 'body': contents + 'body': contents, + 'uploads': tokens }, 'requester': { 'name': "SimpleLogin user {}".format(current_user.id), @@ -29,17 +62,19 @@ def createZendeskTicket(email: str, contents: str): } } } - url = 'https://simplelogin.zendesk.com/api/v2/requests.json' + url = 'https://{}/api/v2/requests.json'.format(ZENDESK_HOST) headers = {'content-type': 'application/json'} r = requests.post(url, data=json.dumps(data), headers=headers) if r.status_code != 201: if r.status_code == 401 or 422: LOG.debug('Could not authenticate') + return False else: LOG.debug('Problem with the request. Status ' + str(r.status_code)) - else: - flash("Ticket was created. You should receive an email notification", "success") - LOG.debug('Ticket created') + return False + flash("Ticket was created. You should receive an email notification", "success") + LOG.debug('Ticket created') + return True @dashboard_bp.route("/support", methods=["POST"]) @@ -53,5 +88,6 @@ def process_support_dialog(): if not email: flash("Please add an email", "warning") return render_template("dashboard/support.html", ticketContents=contents) - createZendeskTicket(email, contents) - return redirect(url_for('dashboard.index')) + if create_zendesk_request(email, contents, request.files.getlist('ticketFiles')): + return render_template("dashboard/support_ticket_created.html", ticketEmail=email) + return render_template("dashboard/support.html", ticketEmail=email, ticketContents=contents) diff --git a/templates/dashboard/support.html b/templates/dashboard/support.html index 22826dfe..8797d52d 100644 --- a/templates/dashboard/support.html +++ b/templates/dashboard/support.html @@ -19,7 +19,7 @@ {% endblock %} @@ -50,7 +60,7 @@
A support ticket will be created in Zendesk. Please do not include any sensitive information in the ticket.
-
+
@@ -58,8 +68,9 @@
Attach files to support request
+
Only images, text and emails are accepted
- +
@@ -68,7 +79,7 @@
Conversations related to this ticket will be sent to this address. Feel free to use an alias here.
-
+
diff --git a/templates/dashboard/support_ticket_created.html b/templates/dashboard/support_ticket_created.html new file mode 100644 index 00000000..e1679531 --- /dev/null +++ b/templates/dashboard/support_ticket_created.html @@ -0,0 +1,37 @@ +{% extends 'default.html' %} + +{% set active_page = None %} + +{% block title %} + Support +{% endblock %} + +{% block head %} + +{% endblock %} + +{% block default_content %} + +
+ +
+
+
Support ticket has been created for {{ ticketEmail }}
+
+ Head back to your dashboard +
+
+
+ +
+ +{% endblock %} + + + diff --git a/templates/footer.html b/templates/footer.html index 6fa0c4f6..12a15ec8 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -66,6 +66,7 @@ href="https://github.com/simple-login/app/projects/1">Roadmap
  • Contact Us
  • +
  • Support
  • Imprint
  • From 95fa95649da32df49cd32b35b1a7b4996a89734b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Wed, 9 Feb 2022 16:20:55 +0100 Subject: [PATCH 03/14] Added comments from PR --- app/config.py | 2 +- app/dashboard/views/support.py | 39 ++++++++++--------- templates/dashboard/support.html | 9 +++-- templates/dashboard/support_disabled.html | 34 ++++++++++++++++ .../dashboard/support_ticket_created.html | 2 +- templates/footer.html | 1 - templates/header.html | 25 +++++++++--- 7 files changed, 82 insertions(+), 30 deletions(-) create mode 100644 templates/dashboard/support_disabled.html diff --git a/app/config.py b/app/config.py index 7bfb6433..9442c39a 100644 --- a/app/config.py +++ b/app/config.py @@ -413,4 +413,4 @@ PHONE_PROVIDER_1_SECRET = os.environ.get("PHONE_PROVIDER_1_SECRET") PHONE_PROVIDER_2_HEADER = os.environ.get("PHONE_PROVIDER_2_HEADER") PHONE_PROVIDER_2_SECRET = os.environ.get("PHONE_PROVIDER_2_SECRET") -ZENDESK_HOST=os.environ.get('ZENDESK_HOST', 'noone.zendesk.com') +ZENDESK_HOST=os.environ.get('ZENDESK_HOST') diff --git a/app/dashboard/views/support.py b/app/dashboard/views/support.py index d59932ec..e703be02 100644 --- a/app/dashboard/views/support.py +++ b/app/dashboard/views/support.py @@ -18,25 +18,31 @@ VALID_MIME_TYPES = ['text/plain', 'message/rfc822'] @dashboard_bp.route("/support", methods=["GET"]) @login_required def show_support_dialog(): - mailbox = Mailbox.get(current_user.default_mailbox_id) - return render_template("dashboard/support.html", ticketEmail=mailbox.email) + if not ZENDESK_HOST: + return render_template("dashboard/support_disabled.html") + return render_template("dashboard/support.html", ticketEmail=current_user.email) + + +def check_zendesk_response_status(response_code: int) -> bool: + if response_code != 201: + if response_code in (401 or 422): + LOG.debug('Could not authenticate') + else: + LOG.debug('Problem with the request. Status {}'.format(response_code)) + return False + return True def upload_file_to_zendesk(file: FileStorage) -> Union[None, str]: if file.mimetype not in VALID_MIME_TYPES and not file.mimetype.startswith('image/'): flash('File {} is not an image, text or an email'.format(file.filename), "warning") - return None + return escaped_filename = urllib.parse.urlencode({'filename': file.filename}) url = 'https://{}/api/v2/uploads?{}'.format(ZENDESK_HOST, escaped_filename) headers = {'content-type': file.mimetype} response = requests.post(url, headers=headers, data=file.stream) - if response.status_code != 201: - if response.status_code == 401 or 422: - LOG.debug('Could not authenticate') - return None - else: - LOG.debug('Problem with the request. Status ' + str(response.status_code)) - return None + if not check_zendesk_response_status(response.status_code): + return data = response.json() return data['upload']['token'] @@ -64,14 +70,9 @@ def create_zendesk_request(email: str, contents: str, files: [FileStorage]) -> b } url = 'https://{}/api/v2/requests.json'.format(ZENDESK_HOST) headers = {'content-type': 'application/json'} - r = requests.post(url, data=json.dumps(data), headers=headers) - if r.status_code != 201: - if r.status_code == 401 or 422: - LOG.debug('Could not authenticate') - return False - else: - LOG.debug('Problem with the request. Status ' + str(r.status_code)) - return False + response = requests.post(url, data=json.dumps(data), headers=headers) + if not check_zendesk_response_status(response.status_code): + return False flash("Ticket was created. You should receive an email notification", "success") LOG.debug('Ticket created') return True @@ -80,6 +81,8 @@ def create_zendesk_request(email: str, contents: str, files: [FileStorage]) -> b @dashboard_bp.route("/support", methods=["POST"]) @login_required def process_support_dialog(): + if not ZENDESK_HOST: + return render_template("dashboard/support_disabled.html") contents = request.form.get("ticketContents") or "" email = request.form.get("ticketEmail") or "" if not contents: diff --git a/templates/dashboard/support.html b/templates/dashboard/support.html index 8797d52d..b50ba95b 100644 --- a/templates/dashboard/support.html +++ b/templates/dashboard/support.html @@ -1,6 +1,6 @@ {% extends 'default.html' %} -{% set active_page = None %} +{% set active_page = 'dashboard' %} {% block title %} Support @@ -14,14 +14,15 @@ margin-bottom: 3px; } +{% endblock %} - +{% block script %} {% endblock %} @@ -64,14 +60,14 @@
    - +
    Attach files to support request
    Only images, text and emails are accepted
    - +
    @@ -81,7 +77,7 @@ Conversations related to this ticket will be sent to this address. Feel free to use an alias here.
    - +
    From f59c5499fb379f8e94a338300974dc7a6864e661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Thu, 10 Feb 2022 10:30:28 +0100 Subject: [PATCH 05/14] Formatting --- app/config.py | 2 +- app/dashboard/views/support.py | 52 ++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/app/config.py b/app/config.py index 9442c39a..70fefdb9 100644 --- a/app/config.py +++ b/app/config.py @@ -413,4 +413,4 @@ PHONE_PROVIDER_1_SECRET = os.environ.get("PHONE_PROVIDER_1_SECRET") PHONE_PROVIDER_2_HEADER = os.environ.get("PHONE_PROVIDER_2_HEADER") PHONE_PROVIDER_2_SECRET = os.environ.get("PHONE_PROVIDER_2_SECRET") -ZENDESK_HOST=os.environ.get('ZENDESK_HOST') +ZENDESK_HOST = os.environ.get("ZENDESK_HOST") diff --git a/app/dashboard/views/support.py b/app/dashboard/views/support.py index c39ffd1a..743f525b 100644 --- a/app/dashboard/views/support.py +++ b/app/dashboard/views/support.py @@ -12,7 +12,7 @@ from app.log import LOG from app.models import Mailbox from app.config import ZENDESK_HOST -VALID_MIME_TYPES = ['text/plain', 'message/rfc822'] +VALID_MIME_TYPES = ["text/plain", "message/rfc822"] @dashboard_bp.route("/support", methods=["GET"]) @@ -26,25 +26,27 @@ def show_support_dialog(): def check_zendesk_response_status(response_code: int) -> bool: if response_code != 201: if response_code in (401 or 422): - LOG.debug('Could not authenticate') + LOG.debug("Could not authenticate") else: - LOG.debug('Problem with the request. Status {}'.format(response_code)) + LOG.debug("Problem with the request. Status {}".format(response_code)) return False return True def upload_file_to_zendesk_and_get_upload_token(file: FileStorage) -> Union[None, str]: - if file.mimetype not in VALID_MIME_TYPES and not file.mimetype.startswith('image/'): - flash('File {} is not an image, text or an email'.format(file.filename), "warning") + if file.mimetype not in VALID_MIME_TYPES and not file.mimetype.startswith("image/"): + flash( + "File {} is not an image, text or an email".format(file.filename), "warning" + ) return - escaped_filename = urllib.parse.urlencode({'filename': file.filename}) - url = 'https://{}/api/v2/uploads?{}'.format(ZENDESK_HOST, escaped_filename) - headers = {'content-type': file.mimetype} + escaped_filename = urllib.parse.urlencode({"filename": file.filename}) + url = "https://{}/api/v2/uploads?{}".format(ZENDESK_HOST, escaped_filename) + headers = {"content-type": file.mimetype} response = requests.post(url, headers=headers, data=file.stream) if not check_zendesk_response_status(response.status_code): return data = response.json() - return data['upload']['token'] + return data["upload"]["token"] def create_zendesk_request(email: str, content: str, files: [FileStorage]) -> bool: @@ -57,26 +59,22 @@ def create_zendesk_request(email: str, content: str, files: [FileStorage]) -> bo return False tokens.append(token) data = { - 'request': { - 'subject': 'Ticket created for user {}'.format(current_user.id), - 'comment': { - 'type': 'Comment', - 'body': content, - 'uploads': tokens + "request": { + "subject": "Ticket created for user {}".format(current_user.id), + "comment": {"type": "Comment", "body": content, "uploads": tokens}, + "requester": { + "name": "SimpleLogin user {}".format(current_user.id), + "email": email, }, - 'requester': { - 'name': "SimpleLogin user {}".format(current_user.id), - 'email': email - } } } - url = 'https://{}/api/v2/requests.json'.format(ZENDESK_HOST) - headers = {'content-type': 'application/json'} + url = "https://{}/api/v2/requests.json".format(ZENDESK_HOST) + headers = {"content-type": "application/json"} response = requests.post(url, data=json.dumps(data), headers=headers) if not check_zendesk_response_status(response.status_code): return False flash("Ticket was created. You should receive an email notification", "success") - LOG.debug('Ticket created') + LOG.debug("Ticket created") return True @@ -93,6 +91,10 @@ def process_support_dialog(): if not email: flash("Please add an email", "warning") return render_template("dashboard/support.html", ticket_content=content) - if create_zendesk_request(email, content, request.files.getlist('ticket_files')): - return render_template("dashboard/support_ticket_created.html", ticket_email=email) - return render_template("dashboard/support.html", ticket_email=email, ticket_content=content) + if create_zendesk_request(email, content, request.files.getlist("ticket_files")): + return render_template( + "dashboard/support_ticket_created.html", ticket_email=email + ) + return render_template( + "dashboard/support.html", ticket_email=email, ticket_content=content + ) From e844c9a392bb5f8ba1b1d31155629930904c6c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Thu, 10 Feb 2022 11:04:36 +0100 Subject: [PATCH 06/14] Removed disabled page and redirected to the normal dashboard --- app/dashboard/views/support.py | 3 +- templates/dashboard/support_disabled.html | 34 ----------------------- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 templates/dashboard/support_disabled.html diff --git a/app/dashboard/views/support.py b/app/dashboard/views/support.py index 743f525b..af8cf863 100644 --- a/app/dashboard/views/support.py +++ b/app/dashboard/views/support.py @@ -19,7 +19,8 @@ VALID_MIME_TYPES = ["text/plain", "message/rfc822"] @login_required def show_support_dialog(): if not ZENDESK_HOST: - return render_template("dashboard/support_disabled.html") + flash("Support form is not enabled", "warning") + return redirect(url_for("dashboard.index")) return render_template("dashboard/support.html", ticket_email=current_user.email) diff --git a/templates/dashboard/support_disabled.html b/templates/dashboard/support_disabled.html deleted file mode 100644 index e134fb19..00000000 --- a/templates/dashboard/support_disabled.html +++ /dev/null @@ -1,34 +0,0 @@ -{% extends 'default.html' %} - -{% set active_page = None %} - -{% block title %} - Support -{% endblock %} - -{% block head %} - -{% endblock %} - -{% block default_content %} - -
    - -
    -
    -
    Support form is disabled. Please configure Zendesk integration.
    -
    -
    - -
    - -{% endblock %} - - - From 3fedc84c957fbfa74a4588db693350988a63f020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Thu, 10 Feb 2022 12:34:46 +0100 Subject: [PATCH 07/14] Add rate limit to ticket createion --- app/dashboard/views/support.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/dashboard/views/support.py b/app/dashboard/views/support.py index af8cf863..1556ab17 100644 --- a/app/dashboard/views/support.py +++ b/app/dashboard/views/support.py @@ -3,11 +3,12 @@ import urllib.parse from typing import Union import requests -from flask import render_template, request, flash, url_for, redirect +from flask import render_template, request, flash, url_for, redirect, g from flask_login import login_required, current_user from werkzeug.datastructures import FileStorage from app.dashboard.base import dashboard_bp +from app.extensions import limiter from app.log import LOG from app.models import Mailbox from app.config import ZENDESK_HOST @@ -81,6 +82,9 @@ def create_zendesk_request(email: str, content: str, files: [FileStorage]) -> bo @dashboard_bp.route("/support", methods=["POST"]) @login_required +@limiter.limit( + "2/hour", deduct_when=lambda r: hasattr(g, "deduct_limit") and g.deduct_limit +) def process_support_dialog(): if not ZENDESK_HOST: return render_template("dashboard/support_disabled.html") @@ -92,10 +96,11 @@ def process_support_dialog(): if not email: flash("Please add an email", "warning") return render_template("dashboard/support.html", ticket_content=content) - if create_zendesk_request(email, content, request.files.getlist("ticket_files")): + if not create_zendesk_request( + email, content, request.files.getlist("ticket_files") + ): return render_template( - "dashboard/support_ticket_created.html", ticket_email=email + "dashboard/support.html", ticket_email=email, ticket_content=content ) - return render_template( - "dashboard/support.html", ticket_email=email, ticket_content=content - ) + g.deduct_limit = True + return render_template("dashboard/support_ticket_created.html", ticket_email=email) From c9974d53217541075497382f96acc5732c49f32d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Thu, 10 Feb 2022 12:38:56 +0100 Subject: [PATCH 08/14] Removed successful ticket created page and replaced with notification --- app/dashboard/views/support.py | 4 +- .../dashboard/support_ticket_created.html | 37 ------------------- templates/header.html | 2 +- 3 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 templates/dashboard/support_ticket_created.html diff --git a/app/dashboard/views/support.py b/app/dashboard/views/support.py index 1556ab17..387217ef 100644 --- a/app/dashboard/views/support.py +++ b/app/dashboard/views/support.py @@ -75,7 +75,6 @@ def create_zendesk_request(email: str, content: str, files: [FileStorage]) -> bo response = requests.post(url, data=json.dumps(data), headers=headers) if not check_zendesk_response_status(response.status_code): return False - flash("Ticket was created. You should receive an email notification", "success") LOG.debug("Ticket created") return True @@ -103,4 +102,5 @@ def process_support_dialog(): "dashboard/support.html", ticket_email=email, ticket_content=content ) g.deduct_limit = True - return render_template("dashboard/support_ticket_created.html", ticket_email=email) + flash("Ticket created. You should have received an email notification.", "success") + return redirect(url_for("dashboard.index")) diff --git a/templates/dashboard/support_ticket_created.html b/templates/dashboard/support_ticket_created.html deleted file mode 100644 index 0b2d2cc2..00000000 --- a/templates/dashboard/support_ticket_created.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends 'default.html' %} - -{% set active_page = None %} - -{% block title %} - Support -{% endblock %} - -{% block head %} - -{% endblock %} - -{% block default_content %} - -
    - -
    -
    -
    Support ticket has been created for {{ ticketEmail }}
    -
    - You should have received an email notification. We'll get in contact with you shortly. -
    -
    -
    - -
    - -{% endblock %} - - - diff --git a/templates/header.html b/templates/header.html index a331f63d..1ecfc90a 100644 --- a/templates/header.html +++ b/templates/header.html @@ -81,7 +81,7 @@