forked from CGM_Public/pretix_original
Allow to disable ticket attachments to emails
This commit is contained in:
@@ -291,6 +291,8 @@ def mail_send_task(self, *args, to: List[str], subject: str, body: str, html: st
|
||||
order = None
|
||||
else:
|
||||
with language(order.locale, event.settings.region):
|
||||
if not event.settings.mail_attach_tickets:
|
||||
attach_tickets = False
|
||||
if position:
|
||||
try:
|
||||
position = order.positions.get(pk=position)
|
||||
|
||||
@@ -13,6 +13,7 @@ from django.core.validators import (
|
||||
MaxValueValidator, MinValueValidator, RegexValidator,
|
||||
)
|
||||
from django.db.models import Model
|
||||
from django.utils.text import format_lazy
|
||||
from django.utils.translation import (
|
||||
gettext_lazy as _, gettext_noop, pgettext, pgettext_lazy,
|
||||
)
|
||||
@@ -1322,6 +1323,19 @@ DEFAULTS = {
|
||||
'default': 'classic',
|
||||
'type': str
|
||||
},
|
||||
'mail_attach_tickets': {
|
||||
'default': 'True',
|
||||
'type': bool,
|
||||
'form_class': forms.BooleanField,
|
||||
'serializer_class': serializers.BooleanField,
|
||||
'form_kwargs': dict(
|
||||
label=_("Attach ticket files"),
|
||||
help_text=format_lazy(
|
||||
_("Tickets will never be attached if they're larger than {size} to avoid email delivery problems."),
|
||||
size='4 MB'
|
||||
),
|
||||
)
|
||||
},
|
||||
'mail_attach_ical': {
|
||||
'default': 'False',
|
||||
'type': bool,
|
||||
|
||||
Reference in New Issue
Block a user