Fix logging error for automated emails

This commit is contained in:
Raphael Michel
2021-10-07 10:07:58 +02:00
parent 65167cc290
commit f459f1f12d
2 changed files with 3 additions and 2 deletions

View File

@@ -2212,7 +2212,7 @@ class OrderPosition(AbstractPosition):
:param attach_ical: Attach relevant ICS files :param attach_ical: Attach relevant ICS files
""" """
from pretix.base.services.mail import ( from pretix.base.services.mail import (
SendMailException, mail, render_mail, SendMailException, TolerantDict, mail, render_mail,
) )
if not self.attendee_email: if not self.attendee_email:
@@ -2225,6 +2225,7 @@ class OrderPosition(AbstractPosition):
recipient = self.attendee_email recipient = self.attendee_email
try: try:
email_content = render_mail(template, context) email_content = render_mail(template, context)
subject = str(subject).format_map(TolerantDict(context))
mail( mail(
recipient, subject, template, context, recipient, subject, template, context,
self.event, self.order.locale, order=self.order, headers=headers, sender=sender, self.event, self.order.locale, order=self.order, headers=headers, sender=sender,

View File

@@ -28,7 +28,7 @@
<br/><span class="fa fa-fw fa-envelope-o"></span> {{ log.parsed_data.recipient }} <br/><span class="fa fa-fw fa-envelope-o"></span> {{ log.parsed_data.recipient }}
{% endif %} {% endif %}
</p> </p>
{% if log.parsed_data.subject.items %} {% if log.parsed_data.message.items %}
<div class="alert alert-info"> <div class="alert alert-info">
{% blocktrans trimmed %} {% blocktrans trimmed %}
This email has been sent with an older version of pretix. We are therefore not able to This email has been sent with an older version of pretix. We are therefore not able to