email_administrator.py: fix report formatting (#2249)
This commit is contained in:
parent
c9584148a0
commit
963fb9f2e6
|
@ -29,7 +29,7 @@ content = sys.stdin.read().strip()
|
||||||
|
|
||||||
# If there's nothing coming in, just exit.
|
# If there's nothing coming in, just exit.
|
||||||
if content == "":
|
if content == "":
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# create MIME message
|
# create MIME message
|
||||||
msg = MIMEMultipart('alternative')
|
msg = MIMEMultipart('alternative')
|
||||||
|
@ -41,7 +41,7 @@ msg['From'] = "\"%s\" <%s>" % (env['PRIMARY_HOSTNAME'], admin_addr)
|
||||||
msg['To'] = admin_addr
|
msg['To'] = admin_addr
|
||||||
msg['Subject'] = "[%s] %s" % (env['PRIMARY_HOSTNAME'], subject)
|
msg['Subject'] = "[%s] %s" % (env['PRIMARY_HOSTNAME'], subject)
|
||||||
|
|
||||||
content_html = "<html><body><pre>{}</pre></body></html>".format(html.escape(content))
|
content_html = '<html><body><pre style="overflow-x: scroll; white-space: pre;">{}</pre></body></html>'.format(html.escape(content))
|
||||||
|
|
||||||
msg.attach(MIMEText(content, 'plain'))
|
msg.attach(MIMEText(content, 'plain'))
|
||||||
msg.attach(MIMEText(content_html, 'html'))
|
msg.attach(MIMEText(content_html, 'html'))
|
||||||
|
|
Loading…
Reference in New Issue