1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-21 20:44:18 +00:00

🐛 Use UTF8 encoding in emails

This commit is contained in:
Steffo 2021-05-30 17:26:22 +02:00
parent 27485e8e7e
commit d32537ba9b
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -54,7 +54,7 @@ def send_notification_email(alert):
smtpObj.login(os.environ["SMTP_USERNAME"], os.environ["SMTP_PASSWORD"])
smtpObj.sendmail(os.environ["SMTP_FROM_EMAIL"],
alert.repository.owner.email,
MESSAGE.format(alert_name=alert.name, now=datetime.now().isoformat()))
MESSAGE.format(alert_name=alert.name, now=datetime.now().isoformat()).encode("utf8"))
print("Successfully sent email")
except smtplib.SMTPException:
print("Error: unable to send email")