forked from CGM_Public/pretix_original
Allow to disable ticket attachments to emails
This commit is contained in:
@@ -656,6 +656,7 @@ class EventSettingsSerializer(SettingsSerializer):
|
|||||||
'mail_from',
|
'mail_from',
|
||||||
'mail_from_name',
|
'mail_from_name',
|
||||||
'mail_attach_ical',
|
'mail_attach_ical',
|
||||||
|
'mail_attach_tickets',
|
||||||
'invoice_address_asked',
|
'invoice_address_asked',
|
||||||
'invoice_address_required',
|
'invoice_address_required',
|
||||||
'invoice_address_vatid',
|
'invoice_address_vatid',
|
||||||
|
|||||||
@@ -291,6 +291,8 @@ def mail_send_task(self, *args, to: List[str], subject: str, body: str, html: st
|
|||||||
order = None
|
order = None
|
||||||
else:
|
else:
|
||||||
with language(order.locale, event.settings.region):
|
with language(order.locale, event.settings.region):
|
||||||
|
if not event.settings.mail_attach_tickets:
|
||||||
|
attach_tickets = False
|
||||||
if position:
|
if position:
|
||||||
try:
|
try:
|
||||||
position = order.positions.get(pk=position)
|
position = order.positions.get(pk=position)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ from django.core.validators import (
|
|||||||
MaxValueValidator, MinValueValidator, RegexValidator,
|
MaxValueValidator, MinValueValidator, RegexValidator,
|
||||||
)
|
)
|
||||||
from django.db.models import Model
|
from django.db.models import Model
|
||||||
|
from django.utils.text import format_lazy
|
||||||
from django.utils.translation import (
|
from django.utils.translation import (
|
||||||
gettext_lazy as _, gettext_noop, pgettext, pgettext_lazy,
|
gettext_lazy as _, gettext_noop, pgettext, pgettext_lazy,
|
||||||
)
|
)
|
||||||
@@ -1322,6 +1323,19 @@ DEFAULTS = {
|
|||||||
'default': 'classic',
|
'default': 'classic',
|
||||||
'type': str
|
'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': {
|
'mail_attach_ical': {
|
||||||
'default': 'False',
|
'default': 'False',
|
||||||
'type': bool,
|
'type': bool,
|
||||||
|
|||||||
@@ -786,6 +786,7 @@ class MailSettingsForm(SettingsForm):
|
|||||||
'mail_from',
|
'mail_from',
|
||||||
'mail_from_name',
|
'mail_from_name',
|
||||||
'mail_attach_ical',
|
'mail_attach_ical',
|
||||||
|
'mail_attach_tickets',
|
||||||
]
|
]
|
||||||
|
|
||||||
mail_sales_channel_placed_paid = forms.MultipleChoiceField(
|
mail_sales_channel_placed_paid = forms.MultipleChoiceField(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
{% bootstrap_field form.mail_from_name layout="control" %}
|
{% bootstrap_field form.mail_from_name layout="control" %}
|
||||||
{% bootstrap_field form.mail_text_signature layout="control" %}
|
{% bootstrap_field form.mail_text_signature layout="control" %}
|
||||||
{% bootstrap_field form.mail_bcc layout="control" %}
|
{% bootstrap_field form.mail_bcc layout="control" %}
|
||||||
|
{% bootstrap_field form.mail_attach_tickets layout="control" %}
|
||||||
{% bootstrap_field form.mail_attach_ical layout="control" %}
|
{% bootstrap_field form.mail_attach_ical layout="control" %}
|
||||||
{% bootstrap_field form.mail_sales_channel_placed_paid layout="control" %}
|
{% bootstrap_field form.mail_sales_channel_placed_paid layout="control" %}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
Reference in New Issue
Block a user