Fixed #45: Custom SMTP server

This commit is contained in:
Raphael Michel
2015-12-13 17:56:35 +01:00
parent 7e69d8ea10
commit a114aa11f4
7 changed files with 110 additions and 8 deletions

View File

@@ -28,14 +28,14 @@ class SenderView(EventPermissionRequiredMixin, FormView):
orders = Order.objects.filter(
event=self.request.event, status__in=form.cleaned_data['sendto']
)
mails = set([o.email for o in orders])
mails = set([(o.email, o.locale) for o in orders])
self.request.event.log_action('pretix.plugins.sendmail.sent', user=self.request.user, data=dict(
form.cleaned_data))
for m in mails:
for m, l in mails:
mail(m, form.cleaned_data['subject'], form.cleaned_data['message'],
None, self.request.event, locale=m.locale)
None, self.request.event, locale=l)
messages.success(self.request, _('Your message will be sent to the selected users.'))