Fixed #46 -- Added a plugin to send out emails

This commit is contained in:
Raphael Michel
2015-07-12 18:45:22 +02:00
parent e2215d2baa
commit 478b900ab3
11 changed files with 341 additions and 117 deletions

View File

@@ -0,0 +1,25 @@
from django import forms
from django.utils.translation import ugettext_lazy as _
from pretix.base.i18n import I18nFormField, I18nTextarea, I18nTextInput
from pretix.base.models import Order
class MailForm(forms.Form):
sendto = forms.MultipleChoiceField(
label=_("Send to"), widget=forms.CheckboxSelectMultiple,
choices=Order.STATUS_CHOICE
)
subject = forms.CharField(label=_("Subject"))
message = forms.CharField(label=_("Message"))
def __init__(self, *args, **kwargs):
event = kwargs.pop('event')
super().__init__(*args, **kwargs)
self.fields['subject'] = I18nFormField(
widget=I18nTextInput, required=True,
langcodes=event.settings.get('locales')
)
self.fields['message'] = I18nFormField(
widget=I18nTextarea, required=True,
langcodes=event.settings.get('locales')
)