rattail.mail
¶
Email Framework
- class rattail.mail.EmailHandler(config)[source]¶
Base class and default implementation for email handlers.
- deliver_message(email, msg, recipients=<object object>)[source]¶
Deliver an email message using the given SMTP configuration.
- email_is_available(email)[source]¶
Returns boolean indicating if the Email profile for the given key is “available” and should be exposed to users.
- email_is_enabled(email)[source]¶
Returns boolean indicating if the given Email profile is “enabled” - that is, emails of its type should be sent as opposed to being suppressed.
Returns boolean indicating if the given Email profile is “hidden” and should not be exposed to users.
- get_all_emails(**kwargs)[source]¶
Retrieve the complete set of all Email profiles exposed by the app and installed packages.
- get_available_emails(**kwargs)[source]¶
Retrieve the set of “available” Email profiles, i.e. those which should be exposed to the app users.
- get_emails_from_module(module, **kwargs)[source]¶
Return all Email profiles from the given Python module.
- should_record_attempts()[source]¶
Returns a boolean indicating if the app should make a record of all attempts to send email.
- rattail.mail.send_email(config, key, data={}, attachments=[], fallback_key=None, default_subject=None, enabled=<object object>, **kwargs)[source]¶
Send an email message of the given type, per config, with the given data and/or attachments.
- class rattail.mail.Email[source]¶
Represents an email message, of a particular type. Various aspects of the message may be defined by a subclass and/or configuration.
- Attribute key:
Unique key for a particular type of email. This is used to determine which template(s) will be used to generate the email body, as well as the email sender and recipients (via config/settings), etc.