Add email subject line and sending newsletters

This commit is contained in:
JonnyWong16 2018-01-09 01:14:19 -08:00
commit 5ac5b3cd29
6 changed files with 94 additions and 59 deletions

View file

@ -454,7 +454,7 @@ def get_notifier_config(notifier_id=None):
return None
try:
config = json.loads(result.pop('notifier_config') or '{}')
config = json.loads(result.pop('notifier_config', '{}'))
notifier_agent = get_agent_class(agent_id=result['agent_id'], config=config)
notifier_config = notifier_agent.return_config_options()
except Exception as e:
@ -772,6 +772,9 @@ class Notifier(object):
return new_config
def return_default_config(self):
return self._DEFAULT_CONFIG
def notify(self, subject='', body='', action='', **kwargs):
if self.NAME != 'Script':
if not subject and self.config.get('incl_subject', True):
@ -1271,7 +1274,7 @@ class EMAIL(Notifier):
Email notifications
"""
NAME = 'Email'
_DEFAULT_CONFIG = {'from_name': '',
_DEFAULT_CONFIG = {'from_name': 'Tautulli',
'from': '',
'to': '',
'cc': '',