|
None | __init__ (self, int error=84, int success=0, bool debug=False) |
|
int | send_email (self, str receiver, str subject, str body, str body_type="html") |
|
int | send_email_with_attachment (self, str receiver, str subject, str body, List[str] attachments, str body_type="html") |
|
int | send_email_to_multiple (self, List[str] receivers, str subject, str body, str body_type="html") |
|
int | send_email_with_inline_image (self, str receiver, str subject, str body, str image_path, str body_type="html") |
|
|
int | _send (self, EmailMessage em) |
|
_summary_
Definition at line 16 of file mail_management.py.
◆ __init__()
None src.lib.components.mail_management.MailManagement.__init__ |
( |
| self, |
|
|
int | error = 84, |
|
|
int | success = 0, |
|
|
bool | debug = False ) |
_summary_
The class in charge of allowing the user to send e-mails.
Args:
error (int, optional): _description_. Defaults to 84.
success (int, optional): _description_. Defaults to 0.
debug (bool, optional): _description_. Defaults to False.
Definition at line 20 of file mail_management.py.
◆ _send()
int src.lib.components.mail_management.MailManagement._send |
( |
| self, |
|
|
EmailMessage | em ) |
|
protected |
Internal method to handle the actual sending of an email.
Args:
em (EmailMessage): The email message to be sent.
Returns:
int: The status of the email sending operation.
Definition at line 49 of file mail_management.py.
◆ send_email()
int src.lib.components.mail_management.MailManagement.send_email |
( |
| self, |
|
|
str | receiver, |
|
|
str | subject, |
|
|
str | body, |
|
|
str | body_type = "html" ) |
Sends a simple email to a single receiver.
Args:
receiver (str): The recipient's email address.
subject (str): The subject of the email.
body (str): The content of the email.
body_type (str, optional): The MIME type of the email content ('html' or 'plain'). Defaults to 'html'.
Returns:
int: The status of the email sending operation.
Definition at line 71 of file mail_management.py.
◆ send_email_to_multiple()
int src.lib.components.mail_management.MailManagement.send_email_to_multiple |
( |
| self, |
|
|
List[str] | receivers, |
|
|
str | subject, |
|
|
str | body, |
|
|
str | body_type = "html" ) |
Sends an email to multiple recipients (To, Cc, or Bcc).
Args:
receivers (List[str]): A list of recipients' email addresses.
subject (str): The subject of the email.
body (str): The content of the email.
body_type (str, optional): The MIME type of the email content ('html' or 'plain'). Defaults to 'html'.
Returns:
int: The status of the email sending operation.
Definition at line 149 of file mail_management.py.
◆ send_email_with_attachment()
int src.lib.components.mail_management.MailManagement.send_email_with_attachment |
( |
| self, |
|
|
str | receiver, |
|
|
str | subject, |
|
|
str | body, |
|
|
List[str] | attachments, |
|
|
str | body_type = "html" ) |
Sends an email with one or more attachments.
Args:
receiver (str): The recipient's email address.
subject (str): The subject of the email.
body (str): The content of the email.
attachments (List[str]): List of file paths for attachments.
body_type (str, optional): The MIME type of the email content ('html' or 'plain'). Defaults to 'html'.
Returns:
int: The status of the email sending operation.
Definition at line 96 of file mail_management.py.
◆ send_email_with_inline_image()
int src.lib.components.mail_management.MailManagement.send_email_with_inline_image |
( |
| self, |
|
|
str | receiver, |
|
|
str | subject, |
|
|
str | body, |
|
|
str | image_path, |
|
|
str | body_type = "html" ) |
Sends an email with an inline image embedded in the body.
Args:
receiver (str): The recipient's email address.
subject (str): The subject of the email.
body (str): The content of the email, including a placeholder for the image.
image_path (str): The path to the image to be embedded.
body_type (str, optional): The MIME type of the email content ('html' or 'plain'). Defaults to 'html'.
Returns:
int: The status of the email sending operation.
Definition at line 174 of file mail_management.py.
◆ api_key
src.lib.components.mail_management.MailManagement.api_key = CONST.SENDER_KEY |
◆ debug
src.lib.components.mail_management.MailManagement.debug = debug |
◆ disp
Disp src.lib.components.mail_management.MailManagement.disp |
Initial value:= Disp(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
FILE_DESCRIPTOR,
debug=self.debug,
logger=self.__class__.__name__
)
Definition at line 40 of file mail_management.py.
◆ error
src.lib.components.mail_management.MailManagement.error = error |
◆ host
src.lib.components.mail_management.MailManagement.host = CONST.SENDER_HOST |
◆ port
src.lib.components.mail_management.MailManagement.port = CONST.SENDER_PORT |
◆ sender
src.lib.components.mail_management.MailManagement.sender = CONST.SENDER_ADDRESS |
◆ success
src.lib.components.mail_management.MailManagement.success = success |
The documentation for this class was generated from the following file: