From 8af91b691d0d4ce9c5ed8af25c73ad1c36460af2 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 1 Mar 2021 18:28:08 +0100 Subject: [PATCH] Allow configurable addition to the order confirmation message --- src/pretix/api/serializers/event.py | 1 + src/pretix/base/settings.py | 13 +++++++++++++ src/pretix/control/forms/event.py | 1 + .../templates/pretixcontrol/event/settings.html | 1 + .../templates/pretixpresale/event/order.html | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/src/pretix/api/serializers/event.py b/src/pretix/api/serializers/event.py index 720d38564..3b512bd99 100644 --- a/src/pretix/api/serializers/event.py +++ b/src/pretix/api/serializers/event.py @@ -596,6 +596,7 @@ class EventSettingsSerializer(SettingsSerializer): 'checkout_email_helptext', 'presale_has_ended_text', 'voucher_explanation_text', + 'checkout_success_text', 'banner_text', 'banner_text_bottom', 'show_dates_on_frontpage', diff --git a/src/pretix/base/settings.py b/src/pretix/base/settings.py index 6a76c2598..1c0658e22 100644 --- a/src/pretix/base/settings.py +++ b/src/pretix/base/settings.py @@ -1997,6 +1997,19 @@ Your {event} team""")) "why you need information from them.") ) }, + 'checkout_success_text': { + 'default': '', + 'type': LazyI18nString, + 'serializer_class': I18nField, + 'form_class': I18nFormField, + 'form_kwargs': dict( + label=_("Additional success message"), + help_text=_("This message will be shown after an order has been created successfully. It will be shown in additional " + "to the default text."), + widget_kwargs={'attrs': {'rows': '2'}}, + widget=I18nTextarea + ) + }, 'checkout_phone_helptext': { 'default': '', 'type': LazyI18nString, diff --git a/src/pretix/control/forms/event.py b/src/pretix/control/forms/event.py index 141f0b9c1..05d7d6641 100644 --- a/src/pretix/control/forms/event.py +++ b/src/pretix/control/forms/event.py @@ -435,6 +435,7 @@ class EventSettingsForm(SettingsForm): 'checkout_email_helptext', 'presale_has_ended_text', 'voucher_explanation_text', + 'checkout_success_text', 'show_dates_on_frontpage', 'show_date_to', 'show_times', diff --git a/src/pretix/control/templates/pretixcontrol/event/settings.html b/src/pretix/control/templates/pretixcontrol/event/settings.html index b02bfc53f..c6423e144 100644 --- a/src/pretix/control/templates/pretixcontrol/event/settings.html +++ b/src/pretix/control/templates/pretixcontrol/event/settings.html @@ -188,6 +188,7 @@ + {% bootstrap_field sform.checkout_success_text layout="control" %} {% bootstrap_field sform.checkout_email_helptext layout="control" %} {% bootstrap_field sform.checkout_phone_helptext layout="control" %} {% bootstrap_field sform.banner_text layout="control" %} diff --git a/src/pretix/presale/templates/pretixpresale/event/order.html b/src/pretix/presale/templates/pretixpresale/event/order.html index 44f9b6e93..c78a52f33 100644 --- a/src/pretix/presale/templates/pretixpresale/event/order.html +++ b/src/pretix/presale/templates/pretixpresale/event/order.html @@ -6,6 +6,7 @@ {% load expiresformat %} {% load eventurl %} {% load phone_format %} +{% load rich_text %} {% block title %} {% if "thanks" in request.GET or "paid" in request.GET %} {% trans "Thank you!" %} @@ -44,6 +45,9 @@ {% else %}

{% trans "We successfully received your payment. See below for details." %}

{% endif %} + {% if request.event.settings.checkout_success_text %} + {{ request.event.settings.checkout_success_text|rich_text }} + {% endif %}

{% blocktrans trimmed %} Please bookmark or save the link to this exact page if you want to access your order later. We also sent you an email containing the link to the address you specified. {% endblocktrans %}