From 91016cf92dbfa3c6711f4b1816e56f1e855aa89f Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 26 Feb 2024 12:31:36 +0100 Subject: [PATCH] refactor(chalice): changed email_handler.py --- api/chalicelib/utils/email_handler.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/api/chalicelib/utils/email_handler.py b/api/chalicelib/utils/email_handler.py index 89291b083..53e89f010 100644 --- a/api/chalicelib/utils/email_handler.py +++ b/api/chalicelib/utils/email_handler.py @@ -13,10 +13,6 @@ from chalicelib.utils import smtp logger = logging.getLogger(__name__) -def __get_subject(subject): - return subject - - def __get_html_from_file(source, formatting_variables): if formatting_variables is None: formatting_variables = {} @@ -53,7 +49,7 @@ def send_html(BODY_HTML, SUBJECT, recipient, bcc=None): if not isinstance(recipient, list): recipient = [recipient] msg = MIMEMultipart() - msg['Subject'] = Header(__get_subject(SUBJECT), 'utf-8') + msg['Subject'] = Header(SUBJECT, 'utf-8') msg['From'] = config("EMAIL_FROM") msg['To'] = "" body = MIMEText(BODY_HTML.encode('utf-8'), 'html', "utf-8") @@ -78,7 +74,7 @@ def send_html(BODY_HTML, SUBJECT, recipient, bcc=None): def send_text(recipients, text, subject): with smtp.SMTPClient() as s: msg = MIMEMultipart() - msg['Subject'] = Header(__get_subject(subject), 'utf-8') + msg['Subject'] = Header(subject, 'utf-8') msg['From'] = config("EMAIL_FROM") msg['To'] = ", ".join(recipients) body = MIMEText(text)