mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Strip whitespace before sending newsletters
This commit is contained in:
parent
7f2bab3082
commit
85772cdd83
3 changed files with 636 additions and 869 deletions
|
@ -456,6 +456,7 @@ class Newsletter(object):
|
|||
for line in self.newsletter.encode('utf-8').splitlines():
|
||||
if '<!-- IGNORE SAVE -->' not in line:
|
||||
n_file.write(line + '\r\n')
|
||||
#n_file.write(line.strip())
|
||||
|
||||
logger.info(u"Tautulli Newsletters :: %s newsletter saved to '%s'" % (self.NAME, newsletter_file))
|
||||
except OSError as e:
|
||||
|
@ -464,18 +465,20 @@ class Newsletter(object):
|
|||
|
||||
def _send(self):
|
||||
if self.config['formatted']:
|
||||
newsletter_stripped = ''.join(l.strip() for l in self.newsletter.splitlines())
|
||||
|
||||
if self.email_config['notifier_id']:
|
||||
return send_notification(
|
||||
notifier_id=self.email_config['notifier_id'],
|
||||
subject=self.subject_formatted,
|
||||
body=self.newsletter
|
||||
body=newsletter_stripped
|
||||
)
|
||||
|
||||
else:
|
||||
email = EMAIL(config=self.email_config)
|
||||
return email.notify(
|
||||
subject=self.subject_formatted,
|
||||
body=self.newsletter
|
||||
body=newsletter_stripped
|
||||
)
|
||||
elif self.config['notifier_id']:
|
||||
return send_notification(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue