Send as html
This commit is contained in:
@@ -15,8 +15,10 @@ class EmailSender:
|
||||
msg['To'] = to_email
|
||||
msg['Subject'] = 'Items in action'
|
||||
|
||||
body = format_product_table(product_info)
|
||||
msg.attach(MIMEText(body, 'plain'))
|
||||
|
||||
body = format_product_table(product_info, tablefmt="html")
|
||||
html_content = MIMEText(body, 'html')
|
||||
msg.attach(html_content)
|
||||
|
||||
server = smtplib.SMTP('smtp.gmail.com', 587)
|
||||
server.starttls()
|
||||
|
||||
Reference in New Issue
Block a user