Correctly respect mail_attach_ical setting on order payments

This commit is contained in:
Raphael Michel
2019-10-23 16:17:39 +02:00
parent 2a51969b04
commit 837775c8d4

View File

@@ -1338,7 +1338,8 @@ class OrderPayment(models.Model):
email_subject, email_template, email_context,
'pretix.event.order.email.order_paid', user,
invoices=[], position=position,
attach_tickets=True, attach_ical=True
attach_tickets=True,
attach_ical=self.order.event.settings.mail_attach_ical
)
except SendMailException:
logger.exception('Order paid email could not be sent')
@@ -1355,7 +1356,8 @@ class OrderPayment(models.Model):
email_subject, email_template, email_context,
'pretix.event.order.email.order_paid', user,
invoices=[invoice] if invoice and self.order.event.settings.invoice_email_attachment else [],
attach_tickets=True, attach_ical=True
attach_tickets=True,
attach_ical=self.order.event.settings.mail_attach_ical
)
except SendMailException:
logger.exception('Order paid email could not be sent')