Include provider-specific text in payment notification mail

This commit is contained in:
Raphael Michel
2017-01-21 13:41:20 +01:00
parent 48a2090e01
commit 2f0cbcc565
3 changed files with 7 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ logger = logging.getLogger(__name__)
def mark_order_paid(order: Order, provider: str=None, info: str=None, date: datetime=None, manual: bool=None, def mark_order_paid(order: Order, provider: str=None, info: str=None, date: datetime=None, manual: bool=None,
force: bool=False, send_mail: bool=True, user: User=None) -> Order: force: bool=False, send_mail: bool=True, user: User=None, mail_text='') -> Order:
""" """
Marks an order as paid. This sets the payment provider, info and date and returns Marks an order as paid. This sets the payment provider, info and date and returns
the order object. the order object.
@@ -81,6 +81,8 @@ def mark_order_paid(order: Order, provider: str=None, info: str=None, date: date
:param send_mail: Whether an email should be sent to the user about this event (default: ``True``). :param send_mail: Whether an email should be sent to the user about this event (default: ``True``).
:type send_mail: boolean :type send_mail: boolean
:param user: The user that performed the change :param user: The user that performed the change
:param mail_text: Additional text to be included in the email
:type mail_text: str
:raises Quota.QuotaExceededException: if the quota is exceeded and ``force`` is ``False`` :raises Quota.QuotaExceededException: if the quota is exceeded and ``force`` is ``False``
""" """
with order.event.lock() as now_dt: with order.event.lock() as now_dt:
@@ -124,6 +126,7 @@ def mark_order_paid(order: Order, provider: str=None, info: str=None, date: date
'downloads': order.event.settings.get('ticket_download', as_type=bool), 'downloads': order.event.settings.get('ticket_download', as_type=bool),
'invoice_name': invoice_name, 'invoice_name': invoice_name,
'invoice_company': invoice_company, 'invoice_company': invoice_company,
'payment_info': mail_text
}, },
order.event, locale=order.locale order.event, locale=order.locale
) )

View File

@@ -231,6 +231,8 @@ Your {event} team"""))
we successfully received your payment for {event}. Thank you! we successfully received your payment for {event}. Thank you!
{payment_info}
You can change your order details and view the status of your order at You can change your order details and view the status of your order at
{url} {url}

View File

@@ -385,7 +385,7 @@ class MailSettingsForm(SettingsForm):
label=_("Text"), label=_("Text"),
required=False, required=False,
widget=I18nTextarea, widget=I18nTextarea,
help_text=_("Available placeholders: {event}, {url}, {invoice_name}, {invoice_company}") help_text=_("Available placeholders: {event}, {url}, {invoice_name}, {invoice_company}, {payment_info}")
) )
mail_text_order_free = I18nFormField( mail_text_order_free = I18nFormField(
label=_("Text"), label=_("Text"),