mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-11 00:56:58 -07:00
Add option to save newsletter only
This commit is contained in:
parent
84406e6797
commit
862ed5ce9f
2 changed files with 14 additions and 2 deletions
|
@ -192,7 +192,14 @@
|
|||
<div class="col-md-12">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="newsletter_config_formatted_checkbox" data-id="newsletter_config_formatted" class="checkboxes" value="1" ${checked(newsletter['config']['formatted'])}> Send newsletter as an HTML formatted Email
|
||||
<input type="checkbox" id="newsletter_config_save_only_checkbox" data-id="newsletter_config_save_only" class="checkboxes" value="1" ${checked(newsletter['config']['save_only'])}> Save Newsletter File Only
|
||||
</label>
|
||||
<p class="help-block">Enable to save the newsletter file without sending it to any notification agent.</p>
|
||||
<input type="hidden" id="newsletter_config_save_only" name="newsletter_config_save_only" value="${newsletter['config']['save_only']}">
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="newsletter_config_formatted_checkbox" data-id="newsletter_config_formatted" class="checkboxes" value="1" ${checked(newsletter['config']['formatted'])}> Send Newsletter as an HTML Formatted Email
|
||||
</label>
|
||||
<p class="help-block">Enable to send the newsletter as an HTML formatted Email. Disable to only send a subject and body message to a different notification agent.</p>
|
||||
<input type="hidden" id="newsletter_config_formatted" name="newsletter_config_formatted" value="${newsletter['config']['formatted']}">
|
||||
|
|
|
@ -306,7 +306,8 @@ class Newsletter(object):
|
|||
'time_frame_units': 'days',
|
||||
'formatted': 1,
|
||||
'notifier_id': 0,
|
||||
'filename': ''}
|
||||
'filename': '',
|
||||
'save_only': 0}
|
||||
_DEFAULT_EMAIL_CONFIG = EMAIL().return_default_config()
|
||||
_DEFAULT_EMAIL_CONFIG['from_name'] = 'Tautulli Newsletter'
|
||||
_DEFAULT_EMAIL_CONFIG['notifier_id'] = 0
|
||||
|
@ -436,6 +437,10 @@ class Newsletter(object):
|
|||
return False
|
||||
|
||||
self._save()
|
||||
|
||||
if self.config['save_only']:
|
||||
return True
|
||||
|
||||
return self._send()
|
||||
|
||||
def _save(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue