diff --git a/src/pretix/control/forms/orders.py b/src/pretix/control/forms/orders.py index 7011c3efc6..f22bdd6431 100644 --- a/src/pretix/control/forms/orders.py +++ b/src/pretix/control/forms/orders.py @@ -612,7 +612,7 @@ class OrderMailForm(forms.Form): ) attach_tickets = forms.BooleanField( label=_("Attach tickets"), - help_text=_("Will be ignored if all tickets in this order exceed a given size limit to ensure email deliverability."), + help_text=_("Will be ignored if tickets exceed a given size limit to ensure email deliverability."), required=False ) attach_invoices = forms.ModelMultipleChoiceField( diff --git a/src/pretix/plugins/sendmail/forms.py b/src/pretix/plugins/sendmail/forms.py index c908816541..67109e77d9 100644 --- a/src/pretix/plugins/sendmail/forms.py +++ b/src/pretix/plugins/sendmail/forms.py @@ -132,6 +132,11 @@ class MailForm(FormPlaceholderMixin, forms.Form): label=pgettext_lazy('subevent', 'Only send to customers with orders created before'), required=False, ) + attach_tickets = forms.BooleanField( + label=_("Attach tickets"), + help_text=_("Will be ignored if tickets exceed a given size limit to ensure email deliverability."), + required=False + ) def clean(self): d = super().clean() diff --git a/src/pretix/plugins/sendmail/tasks.py b/src/pretix/plugins/sendmail/tasks.py index 15e8b5422a..db4fe861c7 100644 --- a/src/pretix/plugins/sendmail/tasks.py +++ b/src/pretix/plugins/sendmail/tasks.py @@ -45,7 +45,7 @@ from pretix.celery_app import app @app.task(base=ProfiledEventTask, acks_late=True) def send_mails(event: Event, user: int, subject: dict, message: dict, orders: list, items: list, recipients: str, filter_checkins: bool, not_checked_in: bool, checkin_lists: list, - attachments: list = None) -> None: + attachments: list = None, attach_tickets: bool = False) -> None: failures = [] user = User.objects.get(pk=user) if user else None orders = Order.objects.filter(pk__in=orders, event=event) @@ -97,6 +97,7 @@ def send_mails(event: Event, user: int, subject: dict, message: dict, orders: li locale=o.locale, order=o, position=p, + attach_tickets=attach_tickets, attach_cached_files=attachments ) o.log_action( @@ -124,6 +125,7 @@ def send_mails(event: Event, user: int, subject: dict, message: dict, orders: li event, locale=o.locale, order=o, + attach_tickets=attach_tickets, attach_cached_files=attachments ) o.log_action( diff --git a/src/pretix/plugins/sendmail/templates/pretixplugins/sendmail/send_form.html b/src/pretix/plugins/sendmail/templates/pretixplugins/sendmail/send_form.html index daca36416a..4250aa6c7a 100644 --- a/src/pretix/plugins/sendmail/templates/pretixplugins/sendmail/send_form.html +++ b/src/pretix/plugins/sendmail/templates/pretixplugins/sendmail/send_form.html @@ -53,6 +53,7 @@ {% bootstrap_field form.subject layout='horizontal' %} {% bootstrap_field form.message layout='horizontal' %} {% bootstrap_field form.attachment layout='horizontal' %} + {% bootstrap_field form.attach_tickets layout='horizontal' %} {% if is_preview %}