forked from CGM_Public/pretix_original
Payment: Add setting to prevent reminder mails (Z#23123914) (#3573)
Adds a checkbox in each payment provider's settings controlling whether sending out expiry reminders should be prevented
This commit is contained in:
@@ -441,6 +441,13 @@ class BasePaymentProvider:
|
||||
'Share this link with customers who should use this payment method.'
|
||||
),
|
||||
)),
|
||||
('_prevent_reminder_mail',
|
||||
forms.BooleanField(
|
||||
label=_('Do not send a payment reminder mail'),
|
||||
help_text=_('Users will not receive a reminder mail to pay for their order before it expires if '
|
||||
'they have chosen this payment method.'),
|
||||
required=False,
|
||||
)),
|
||||
])
|
||||
d['_restricted_countries']._as_type = list
|
||||
d['_restrict_to_sales_channels']._as_type = list
|
||||
@@ -497,6 +504,14 @@ class BasePaymentProvider:
|
||||
if order.status == Order.STATUS_PAID:
|
||||
return _('paid')
|
||||
|
||||
def prevent_reminder_mail(self, order: Order, payment: OrderPayment) -> bool:
|
||||
"""
|
||||
This is called when a periodic task runs and sends out reminder mails to orders that have not been paid yet
|
||||
and are soon expiring.
|
||||
The default implementation returns the content of the _prevent_reminder_mail configuration variable (a boolean value).
|
||||
"""
|
||||
return self.settings.get('_prevent_reminder_mail', as_type=bool, default=False)
|
||||
|
||||
@property
|
||||
def payment_form_fields(self) -> dict:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user