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,9 +387,9 @@ class Order(LoggedModel):
""" """
from pretix.base.services.mail import SendMailException, mail, render_mail from pretix.base.services.mail import SendMailException, mail, render_mail
with language(self.locale):
recipient = self.email recipient = self.email
try: try:
with language(self.locale):
email_content = render_mail(template, context)[0] email_content = render_mail(template, context)[0]
mail( mail(
recipient, subject, template, context, recipient, subject, template, context,

View File

@@ -581,6 +581,7 @@ def send_expiry_warnings(sender, **kwargs):
days = eventsettings.get('mail_days_order_expire_warning', as_type=int) days = eventsettings.get('mail_days_order_expire_warning', as_type=int)
tz = pytz.timezone(eventsettings.get('timezone', settings.TIME_ZONE)) tz = pytz.timezone(eventsettings.get('timezone', settings.TIME_ZONE))
if days and (o.expires - today).days <= days: if days and (o.expires - today).days <= days:
with language(o.locale):
o.expiry_reminder_sent = True o.expiry_reminder_sent = True
o.save() o.save()
try: try: