diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index c0033d54..629fb43b 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -961,6 +961,16 @@

Warning: Public Tautulli domain not set under Web Interface.

+
+ +
+
+ +
+
+

Optional: Enter the full path to your custom newsletter templates folder. Leave blank for default.

+
+

3rd Party APIs

diff --git a/plexpy/config.py b/plexpy/config.py index b0d26188..9fc32b76 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -312,6 +312,7 @@ _CONFIG_DEFINITIONS = { 'MONITOR_REMOTE_ACCESS': (int, 'Monitoring', 0), 'MONITORING_INTERVAL': (int, 'Monitoring', 60), 'MONITORING_USE_WEBSOCKET': (int, 'Monitoring', 0), + 'NEWSLETTER_CUSTOM_DIR': (str, 'Newsletter', ''), 'NEWSLETTER_TEMPLATES': (str, 'Newsletter', 'newsletters'), 'NEWSLETTER_DIR': (str, 'Newsletter', ''), 'NEWSLETTER_SELF_HOSTED': (int, 'Newsletter', 0), diff --git a/plexpy/newsletters.py b/plexpy/newsletters.py index 280c130c..0ab51436 100644 --- a/plexpy/newsletters.py +++ b/plexpy/newsletters.py @@ -267,8 +267,11 @@ def send_newsletter(newsletter_id=None, subject=None, body=None, message=None, n def serve_template(templatename, **kwargs): - interface_dir = os.path.join(str(plexpy.PROG_DIR), 'data/interfaces/') - template_dir = os.path.join(str(interface_dir), plexpy.CONFIG.NEWSLETTER_TEMPLATES) + if plexpy.CONFIG.NEWSLETTER_CUSTOM_DIR: + template_dir = plexpy.CONFIG.NEWSLETTER_CUSTOM_DIR + else: + interface_dir = os.path.join(str(plexpy.PROG_DIR), 'data/interfaces/') + template_dir = os.path.join(str(interface_dir), plexpy.CONFIG.NEWSLETTER_TEMPLATES) _hplookup = TemplateLookup(directories=[template_dir], default_filters=['unicode', 'h']) diff --git a/plexpy/webserve.py b/plexpy/webserve.py index aafa723d..b28da750 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2755,7 +2755,8 @@ class WebInterface(object): "tvmaze_lookup": checked(plexpy.CONFIG.TVMAZE_LOOKUP), "show_advanced_settings": plexpy.CONFIG.SHOW_ADVANCED_SETTINGS, "newsletter_dir": plexpy.CONFIG.NEWSLETTER_DIR, - "newsletter_self_hosted": checked(plexpy.CONFIG.NEWSLETTER_SELF_HOSTED) + "newsletter_self_hosted": checked(plexpy.CONFIG.NEWSLETTER_SELF_HOSTED), + "newsletter_custom_dir": plexpy.CONFIG.NEWSLETTER_CUSTOM_DIR } return serve_template(templatename="settings.html", title="Settings", config=config, kwargs=kwargs)