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.base module

class fobi.contrib.plugins.form_handlers.mail.base.MailHandlerPlugin(user=None)[source]

Bases: fobi.base.FormHandlerPlugin, fobi.contrib.plugins.form_handlers.mail.mixins.MailHandlerMixin

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.base.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.callbacks module

class fobi.contrib.plugins.form_handlers.mail.callbacks.AutoFormMail[source]

Bases: fobi.base.FormCallback, fobi.contrib.plugins.form_handlers.mail.mixins.MailHandlerMixin

Auto mail form entries.

Note, that this callback is not active. In order to activate it, you should import the AutoFormMail and register it using the callback register as follows.

>>> from fobi.base import form_callback_registry
>>> from fobi.contrib.plugins.form_handlers.mail.callbacks import (
>>>     AutoFormMail
>>> )
>>> form_callback_registry.register(AutoFormMail)
callback(form_entry, request, form)[source]

Callback.

Parameters:
  • form_entry
  • request
  • form
Returns:

send_email(rendered_data, files)[source]

Send email.

Might be used in integration packages.

stage = 'form_valid'

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, fobi.contrib.plugins.form_handlers.mail.mixins.MailHandlerMixin

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 0x7f1f5cb08fd0>), ('from_email', <django.forms.fields.EmailField object at 0x7f1f5cb18090>), ('to_name', <django.forms.fields.CharField object at 0x7f1f5cb18150>), ('to_email', <fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField object at 0x7f1f5cb18210>), ('subject', <django.forms.fields.CharField object at 0x7f1f5cb182d0>), ('body', <django.forms.fields.CharField object at 0x7f1f5cb18390>)])
declared_fields = OrderedDict([('from_name', <django.forms.fields.CharField object at 0x7f1f5cb08fd0>), ('from_email', <django.forms.fields.EmailField object at 0x7f1f5cb18090>), ('to_name', <django.forms.fields.CharField object at 0x7f1f5cb18150>), ('to_email', <fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField object at 0x7f1f5cb18210>), ('subject', <django.forms.fields.CharField object at 0x7f1f5cb182d0>), ('body', <django.forms.fields.CharField object at 0x7f1f5cb18390>)])
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.mixins module

class fobi.contrib.plugins.form_handlers.mail.mixins.MailHandlerMixin[source]

Bases: object

Mail handler mixin.

get_base_url(request)[source]

Get base URL.

Might be used in integration packages.

get_rendered_data(cleaned_data, field_name_to_label_map, base_url)[source]

Get rendered data.

Might be used in integration packages.

send_email(rendered_data, files)[source]

Send email.

Might be used in integration packages.

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, **kwargs)[source]

Render.

Module contents