mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Fixed #46 -- Added a plugin to send out emails
This commit is contained in:
25
src/pretix/plugins/sendmail/forms.py
Normal file
25
src/pretix/plugins/sendmail/forms.py
Normal 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')
|
||||
)
|
||||
Reference in New Issue
Block a user