Skip to content

Commit

Permalink
Merge pull request #9 from lapig-ufg/email
Browse files Browse the repository at this point in the history
Date no head
  • Loading branch information
jairomr authored Oct 3, 2024
2 parents b9c45a1 + b3f5787 commit 37d7296
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions workers/send_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
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
from workers.render import template
from workers.utils.emial import html_to_text



def send_email(payload: SendEmail):
try:
SERVER_MAIL = os.environ.get('SERVER_EMAIL')
Expand All @@ -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'])
Expand Down

0 comments on commit 37d7296

Please sign in to comment.