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'])