generate html from plaintext if not set
This commit is contained in:
parent
0c4e48c906
commit
b47d95226d
|
@ -200,8 +200,10 @@ def send_email(to_email, subject, plaintext, html=None):
|
|||
|
||||
msg = MIMEMultipart("alternative")
|
||||
msg.attach(MIMEText(plaintext, "text"))
|
||||
if html:
|
||||
msg.attach(MIMEText(html, "html"))
|
||||
|
||||
if not html:
|
||||
html = plaintext.replace("\n", "<br>")
|
||||
msg.attach(MIMEText(html, "html"))
|
||||
|
||||
msg["Subject"] = subject
|
||||
msg["From"] = f"{SUPPORT_NAME} <{SUPPORT_EMAIL}>"
|
||||
|
|
Loading…
Reference in a new issue