Commit 3520f013 authored by Trevor Cappallo's avatar Trevor Cappallo
Browse files

add monospaced email option

parent 65e7bcd0
......@@ -9,8 +9,8 @@ from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send_status(subject, message, to_list, from_address='no-reply@aer.com',
password=None, text_attachment=None, reply_to='no-reply@aer.com', smtp_server='smtp.aer.com',
def send_status(subject, message, to_list, from_address='no-reply@aer.com', reply_to='no-reply@aer.com',
password=None, text_attachment=None, use_monospaced=True, smtp_server='smtp.aer.com',
**kwargs):
"""Send an email message to a given recipient list."""
mail = MIMEMultipart('mixed')
......@@ -32,6 +32,8 @@ def send_status(subject, message, to_list, from_address='no-reply@aer.com',
logging.warning('Unable to generate text version of email: {0}'.format(str(err)))
final_text = 'HTML ONLY'
if use_monospaced:
message = "<div style='font-family: monospace;'>{}</div>".format(message)
contentPart = MIMEMultipart('alternative')
contentPart.attach(MIMEText(final_text, 'plain'))
contentPart.attach(MIMEText(message, 'html'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment