Sendmail: Allow to attach tickets to emails

This commit is contained in:
Raphael Michel
2022-02-16 10:42:48 +01:00
parent f7d2645e76
commit f3b355e9f3
5 changed files with 20 additions and 3 deletions

View File

@@ -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(