fobi.contrib.plugins.form_handlers.mail package¶
Submodules¶
fobi.contrib.plugins.form_handlers.mail.apps module¶
fobi.contrib.plugins.form_handlers.mail.conf module¶
-
fobi.contrib.plugins.form_handlers.mail.conf.
get_setting
(setting, override=None)[source]¶ Get setting.
Get a setting from
fobi.contrib.plugins.form_handlers.mail
conf module, falling back to the default.If override is not None, it will be used instead of the setting.
Parameters: - setting – String with setting name
- override – Value to use when no setting is available. Defaults to None.
Returns: Setting value.
fobi.contrib.plugins.form_handlers.mail.defaults module¶
fobi.contrib.plugins.form_handlers.mail.fields module¶
-
class
fobi.contrib.plugins.form_handlers.mail.fields.
MultiEmailField
(required=True, widget=None, label=None, initial=None, help_text=u'', error_messages=None, show_hidden_initial=False, validators=[], localize=False, disabled=False, label_suffix=None)[source]¶ Bases:
django.forms.fields.Field
MultiEmailField.
-
code
= 'invalid'¶
-
message
= <django.utils.functional.__proxy__ object>¶
-
widget
¶ alias of
MultiEmailWidget
-
fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers module¶
-
class
fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers.
MailHandlerPlugin
(user=None)[source]¶ Bases:
fobi.base.FormHandlerPlugin
Mail handler plugin.
Sends emails to the person specified. Should be executed before
db_store
andhttp_repost
plugins.-
form
¶ alias of
MailForm
-
name
= <django.utils.functional.__proxy__ object>¶
-
run
(form_entry, request, form, form_element_entries=None)[source]¶ Run.
Parameters: - form_entry (fobi.models.FormEntry) – Instance of
fobi.models.FormEntry
. - request (django.http.HttpRequest) –
- form (django.forms.Form) –
- form_element_entries (iterable) – Iterable of
fobi.models.FormElementEntry
objects.
- form_entry (fobi.models.FormEntry) – Instance of
-
uid
= 'mail'¶
-
-
class
fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers.
MailWizardHandlerPlugin
(user=None)[source]¶ Bases:
fobi.base.FormWizardHandlerPlugin
Mail wizard handler plugin.
Sends emails to the person specified. Should be executed before
db_store
andhttp_repost
plugins.-
form
¶ alias of
MailForm
-
name
= <django.utils.functional.__proxy__ object>¶
-
run
(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]¶ Run.
Parameters: - form_wizard_entry (fobi.models.FormWizardEntry) – Instance
of
fobi.models.FormWizardEntry
. - request (django.http.HttpRequest) –
- form_list (list) – List of
django.forms.Form
instances. - form_wizard (fobi.wizard.views.dynamic.DynamicWizardView) – Instance of
fobi.wizard.views.dynamic.DynamicWizardView
. - form_element_entries (iterable) – Iterable of
fobi.models.FormElementEntry
objects.
- form_wizard_entry (fobi.models.FormWizardEntry) – Instance
of
-
uid
= 'mail'¶
-
fobi.contrib.plugins.form_handlers.mail.forms module¶
-
class
fobi.contrib.plugins.form_handlers.mail.forms.
MailForm
(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]¶ Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
Form for
BooleanSelectPlugin
.-
base_fields
= OrderedDict([('from_name', <django.forms.fields.CharField object at 0x7f7534953ad0>), ('from_email', <django.forms.fields.EmailField object at 0x7f7534953b90>), ('to_name', <django.forms.fields.CharField object at 0x7f7534953c50>), ('to_email', <fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField object at 0x7f7534953d10>), ('subject', <django.forms.fields.CharField object at 0x7f7534953dd0>), ('body', <django.forms.fields.CharField object at 0x7f7534953e90>)])¶
-
declared_fields
= OrderedDict([('from_name', <django.forms.fields.CharField object at 0x7f7534953ad0>), ('from_email', <django.forms.fields.EmailField object at 0x7f7534953b90>), ('to_name', <django.forms.fields.CharField object at 0x7f7534953c50>), ('to_email', <fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField object at 0x7f7534953d10>), ('subject', <django.forms.fields.CharField object at 0x7f7534953dd0>), ('body', <django.forms.fields.CharField object at 0x7f7534953e90>)])¶
-
media
¶
-
plugin_data_fields
= [('from_name', ''), ('from_email', ''), ('to_name', ''), ('to_email', ''), ('subject', ''), ('body', '')]¶
-
fobi.contrib.plugins.form_handlers.mail.helpers module¶
-
fobi.contrib.plugins.form_handlers.mail.helpers.
send_mail
(subject, message, from_email, recipient_list, fail_silently=False, auth_user=None, auth_password=None, connection=None, html_message=None, attachments=None)[source]¶ Send email.
Easy wrapper for sending a single message to a recipient list. All members of the recipient list will see the other recipients in the ‘To’ field.
If auth_user is None, the EMAIL_HOST_USER setting is used. If auth_password is None, the EMAIL_HOST_PASSWORD setting is used.
Note: The API for this method is frozen. New code wanting to extend the functionality should use the EmailMessage class directly.