fobi.contrib.plugins.form_handlers.mail package

Submodules

fobi.contrib.plugins.form_handlers.mail.apps module

class fobi.contrib.plugins.form_handlers.mail.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_handlers_mail'
name = 'fobi.contrib.plugins.form_handlers.mail'

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>
to_python(value)[source]

Normalize data to a list of strings.

validate(value)[source]

Check if value consists only of valid emails.

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 and http_repost plugins.

form

alias of MailForm

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
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.
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 and http_repost plugins.

form

alias of MailForm

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Parameters:
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.

fobi.contrib.plugins.form_handlers.mail.settings module

fobi.contrib.plugins.form_handlers.mail.widgets module

class fobi.contrib.plugins.form_handlers.mail.widgets.MultiEmailWidget(attrs=None)[source]

Bases: django.forms.widgets.Textarea

Multi email widget.

is_hidden = False
media
prep_value(value)[source]

Prepare value before effectively render widget

render(name, value, attrs=None)[source]

Render.

Module contents