Allow to attach files to order confirmation email (#2384)

Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
Raphael Michel
2021-12-16 18:34:18 +01:00
committed by GitHub
parent 8fcc314f09
commit 9f4b834abc
9 changed files with 108 additions and 8 deletions

View File

@@ -941,7 +941,10 @@ def _order_placed_email(event: Event, order: Order, pprov: BasePaymentProvider,
log_entry,
invoices=[invoice] if invoice and event.settings.invoice_email_attachment else [],
attach_tickets=True,
attach_ical=event.settings.mail_attach_ical
attach_ical=event.settings.mail_attach_ical,
attach_other_files=filter(lambda a: a, [
event.settings.get('mail_attachment_new_order', as_type=str, default='')[len('file://'):]
]),
)
except SendMailException:
logger.exception('Order received email could not be sent')
@@ -958,7 +961,10 @@ def _order_placed_email_attendee(event: Event, order: Order, position: OrderPosi
invoices=[],
attach_tickets=True,
position=position,
attach_ical=event.settings.mail_attach_ical
attach_ical=event.settings.mail_attach_ical,
attach_other_files=filter(lambda a: a, [
event.settings.get('mail_attachment_new_order', as_type=str, default='')[len('file://'):]
]),
)
except SendMailException:
logger.exception('Order received email could not be sent to attendee')