From b3f5787f53103bdae8a5d314be8dedc318f0f9e6 Mon Sep 17 00:00:00 2001 From: Jairo Matos Da Rocha Date: Thu, 3 Oct 2024 18:45:42 -0300 Subject: [PATCH] Date no head --- workers/send_email.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/workers/send_email.py b/workers/send_email.py index abdf85e..91c9f93 100644 --- a/workers/send_email.py +++ b/workers/send_email.py @@ -2,6 +2,7 @@ import smtplib, ssl from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart +from email.utils import formatdate from workers.models.email import SendEmail @@ -9,6 +10,7 @@ from workers.utils.emial import html_to_text + def send_email(payload: SendEmail): try: SERVER_MAIL = os.environ.get('SERVER_EMAIL') @@ -23,6 +25,7 @@ def send_email(payload: SendEmail): message["Subject"] = payload['subject'] message["From"] = sender_email message["To"] = receiver_email + message["Date"] = formatdate(localtime=True) to_render = payload['message'] html = template.get_template(to_render['template']).render(to_render['content'])