API Docs¶
Extension¶
Invenio mail module.
-
class
invenio_mail.ext.
InvenioMail
(app=None, stream=None)[source]¶ Invenio-Mail extension.
Extension initialization.
Mails are only printed to the stream if
MAIL_SUPPRESS_SEND
isTrue
.Parameters: - app – Flask application object.
- stream – Stream to print emails to. Defaults to
sys.stdout
.
-
init_app
(app)[source]¶ Flask application initialization.
The initialization will:
- Set default values for the configuration variables.
- Initialise the Flask mail extension.
- Configure the extension to avoid the email sending in case of debug
or
MAIL_SUPPRESS_SEND
config variable set. In this case, the email will be written in the stream configured in the extension.
Parameters: app – Flask application object.
Tasks¶
Templated Messages¶
Template based messages.
-
class
invenio_mail.api.
TemplatedMessage
(template_body=None, template_html=None, ctx=None, **kwargs)[source]¶ Siplify creation of templated messages.
Build message body and HTML based on provided templates.
Provided templates can use keyword arguments
body
andhtml
respectively.Parameters: - template_body – Path to the text template.
- template_html – Path to the html template.
- ctx – A mapping containing additional information passed to the template.
- **kwargs – Keyword arguments as defined in
flask_mail.Message
.