email
Module for the Email messenger.
This module defines the Email messenger class, which is used to send notifications via email.
Typical usage example:
from herald.decorators import Herald
from herald.messengers import EmailMessenger
herald = Herald(".env")
email = EmailMessenger()
@herald(email)
def my_function():
pass
Classes
A class for sending notifications via email. |
- class EmailMessenger(recipient)[source]
Bases:
Messenger
A class for sending notifications via email.
- Parameters:
recipient (str) – String containing the email address of the recipient.
smtp_server – String containing the SMTP server address.
smtp_port – Integer containing the SMTP server port.
smtp_starttls – Boolean indicating whether to use STARTTLS.
smtp_user – String containing the SMTP username.
smtp_password – String containing the SMTP password.
- __init__(recipient)[source]
Initializes the EmailMessenger with the given recipient.
- Parameters:
recipient (str) – String containing the email address of the recipient.