Fix localization of payment reminder email

This commit is contained in:
Raphael Michel
2017-11-11 22:00:43 +01:00
parent aa40a27558
commit 06725441a1
2 changed files with 47 additions and 46 deletions

View File

@@ -387,28 +387,28 @@ class Order(LoggedModel):
"""
from pretix.base.services.mail import SendMailException, mail, render_mail
recipient = self.email
try:
with language(self.locale):
with language(self.locale):
recipient = self.email
try:
email_content = render_mail(template, context)[0]
mail(
recipient, subject, template, context,
self.event, self.locale, self, headers, sender,
invoices=invoices
)
except SendMailException:
raise
else:
self.log_action(
log_entry_type,
user=user,
data={
'subject': subject,
'message': email_content,
'recipient': recipient,
'invoices': [i.pk for i in invoices] if invoices else []
}
)
except SendMailException:
raise
else:
self.log_action(
log_entry_type,
user=user,
data={
'subject': subject,
'message': email_content,
'recipient': recipient,
'invoices': [i.pk for i in invoices] if invoices else []
}
)
def answerfile_name(instance, filename: str) -> str: