mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
Add date header to Emails and do not add HTML line breaks automatically
This commit is contained in:
parent
96033a8214
commit
6f912d4aa2
1 changed files with 1 additions and 1 deletions
|
@ -1240,13 +1240,13 @@ class EMAIL(Notifier):
|
||||||
|
|
||||||
def agent_notify(self, subject='', body='', action='', **kwargs):
|
def agent_notify(self, subject='', body='', action='', **kwargs):
|
||||||
if self.config['html_support']:
|
if self.config['html_support']:
|
||||||
body = body.replace('\n', '<br />')
|
|
||||||
msg = MIMEMultipart('alternative')
|
msg = MIMEMultipart('alternative')
|
||||||
msg.attach(MIMEText(bleach.clean(body, strip=True), 'plain', 'utf-8'))
|
msg.attach(MIMEText(bleach.clean(body, strip=True), 'plain', 'utf-8'))
|
||||||
msg.attach(MIMEText(body, 'html', 'utf-8'))
|
msg.attach(MIMEText(body, 'html', 'utf-8'))
|
||||||
else:
|
else:
|
||||||
msg = MIMEText(body, 'plain', 'utf-8')
|
msg = MIMEText(body, 'plain', 'utf-8')
|
||||||
|
|
||||||
|
msg['Date'] = email.utils.formatdate(localtime=True)
|
||||||
msg['Subject'] = subject
|
msg['Subject'] = subject
|
||||||
msg['From'] = email.utils.formataddr((self.config['from_name'], self.config['from']))
|
msg['From'] = email.utils.formataddr((self.config['from_name'], self.config['from']))
|
||||||
msg['To'] = ','.join(self.config['to'])
|
msg['To'] = ','.join(self.config['to'])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue