mails.mixins module

class mails.mixins.MailUtilsMixin(*args, **kwargs)[source]

Bases: object

This mixin takes care of inserting the default data into the Utils or Form.

DEPRECATED

instance = None
mail_data = {}
mail_template = ''
html_message = ''
message = ''
original_recipient = ''
mail_sent = False
delayed_processing = False
pre_validation(*args, **kwargs)[source]

Validate the incoming data to initiate a specific mail.

get_object(**kwargs)[source]
validate_bcc_list()[source]

bcc_to in the .json file may contain multiple raw email addreses or property paths to an email field. The different entries need to be comma separated.

validate_recipients()[source]
validate_message()[source]
validate()[source]

Execute different validation methods.

Only to be used when the default data is used, eg. not in the EmailTemplateForm.

save_mail_data()[source]

Save mail validated mail data; update default values of mail data.

set_alternative_sender(from_name, from_address)[source]

TODO: REMOVE; DEPRECATED

Set an alternative from address/name from the default values received from the json config file. The arguments only take raw string data, no methods/properties!

send()[source]

Send the mail assuming mail_data is validated and complete.