API¶
Anything documented here is part of the public API that Flask-Email-Simplified provides, unless otherwise indicated. Anything not documented here is considered internal or private and may change at any time.
- class flask_email_simplified.EmailExtension(app=None)¶
Flask extension that manages sending email messages with the Email-Simplified library.
- Parameters:
app (App | None)
- init_app(app)¶
Configure the extension with the given Flask application.
Imports the handler class identified by
EMAIL_HANDLERusingget_email_handler(). Callsfrom_config()to create a handler instance. Config is any key prefixed withEMAIL_with the prefix removed and the key converted to lower case.This extension is added to
Flask.extensionswith the"email"key.When
Flask.testingisTrue, the handler will always beTestEmailHandlerunlessEMAIL_TESTING_KEEP_HANDLERisTrue.- Parameters:
app (App)
- Return type:
None
- property handler: EmailHandler¶
The email handler associated with
current_app.When not in an active request or CLI command, an app context must be pushed manually.
- send(messages)¶
Send one or more messages with the email handler associated with
current_app.Messages should typically be
Messageinstances. However, they may also beemail.message.EmailMessageinstances for cases where a non-standard MIME construction is needed.- Parameters:
messages (Message | EmailMessage | list[Message | EmailMessage])
- Return type:
None
- async send_async(messages)¶
Send one or more email messages, as with
send(), in anasynccontext. May not be implemented by some handlers.- Parameters:
messages (Message | EmailMessage | list[Message | EmailMessage])
- Return type:
None