forked from CGM_Public/pretix_original
Fix attendee mails not being sent if no order address set
This commit is contained in:
@@ -976,7 +976,7 @@ class Order(LockModel, LoggedModel):
|
|||||||
SendMailException, TolerantDict, mail, render_mail,
|
SendMailException, TolerantDict, mail, render_mail,
|
||||||
)
|
)
|
||||||
|
|
||||||
if not self.email:
|
if not self.email and not (position and position.attendee_email):
|
||||||
return
|
return
|
||||||
|
|
||||||
for k, v in self.event.meta_data.items():
|
for k, v in self.event.meta_data.items():
|
||||||
@@ -1724,10 +1724,10 @@ class OrderPayment(models.Model):
|
|||||||
email_context = get_email_context(event=self.order.event, order=self.order, position=position)
|
email_context = get_email_context(event=self.order.event, order=self.order, position=position)
|
||||||
email_subject = _('Event registration confirmed: %(code)s') % {'code': self.order.code}
|
email_subject = _('Event registration confirmed: %(code)s') % {'code': self.order.code}
|
||||||
try:
|
try:
|
||||||
self.order.send_mail(
|
position.send_mail(
|
||||||
email_subject, email_template, email_context,
|
email_subject, email_template, email_context,
|
||||||
'pretix.event.order.email.order_paid', user,
|
'pretix.event.order.email.order_paid', user,
|
||||||
invoices=[], position=position,
|
invoices=[],
|
||||||
attach_tickets=True,
|
attach_tickets=True,
|
||||||
attach_ical=self.order.event.settings.mail_attach_ical
|
attach_ical=self.order.event.settings.mail_attach_ical
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -955,12 +955,11 @@ def _order_placed_email_attendee(event: Event, order: Order, position: OrderPosi
|
|||||||
email_subject = _('Your event registration: %(code)s') % {'code': order.code}
|
email_subject = _('Your event registration: %(code)s') % {'code': order.code}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
order.send_mail(
|
position.send_mail(
|
||||||
email_subject, email_template, email_context,
|
email_subject, email_template, email_context,
|
||||||
log_entry,
|
log_entry,
|
||||||
invoices=[],
|
invoices=[],
|
||||||
attach_tickets=True,
|
attach_tickets=True,
|
||||||
position=position,
|
|
||||||
attach_ical=event.settings.mail_attach_ical and (not event.settings.mail_attach_ical_paid_only or is_free),
|
attach_ical=event.settings.mail_attach_ical and (not event.settings.mail_attach_ical_paid_only or is_free),
|
||||||
attach_other_files=[a for a in [
|
attach_other_files=[a for a in [
|
||||||
event.settings.get('mail_attachment_new_order', as_type=str, default='')[len('file://'):]
|
event.settings.get('mail_attachment_new_order', as_type=str, default='')[len('file://'):]
|
||||||
|
|||||||
Reference in New Issue
Block a user