diff --git a/data/interfaces/default/newsletter_config.html b/data/interfaces/default/newsletter_config.html index 47dc861d..aa73649e 100644 --- a/data/interfaces/default/newsletter_config.html +++ b/data/interfaces/default/newsletter_config.html @@ -3,9 +3,11 @@ import json from plexpy import helpers, notifiers - email_notifiers = [n for n in notifiers.get_notifiers() if n['agent_name'] == 'email'] + all_notifiers = notifiers.get_notifiers() + email_notifiers = [n for n in all_notifiers if n['agent_name'] == 'email'] sorted(email_notifiers, key=lambda k: (k['agent_label'], k['friendly_name'], k['id'])) email_notifiers = [{'id': 0, 'agent_label': 'New Email Configuration', 'friendly_name': ''}] + email_notifiers + other_notifiers = [{'id': 0, 'agent_label': 'Select a Notification Agent', 'friendly_name': ''}] + all_notifiers %> -
+
+ +

+ Set the custom formatted text for each type of notification. + Click here for a list of available parameters which can be used. +

- +
- +
+
+

+ Optional: Enter a subject line for the newsletter. Leave blank for default. +

+
+
+ +
+
+ +
+
+

+ Optional: Enter a body line for the newsletter. Leave blank for default.
+ Note: Only sent to notifications agents other than HTML formatted Emails. +

+
+
+
+
+
+
+
+
+ +

Enable to send the newsletter as an HTML formatted Email. Disable to only send a subject and body message to a different notification agent.

+ +
+
+ +
+
+
-

Use an existing Email notification agent or enter a new configuration below.

+

Select an existing Email notification agent or enter a new configuration below.

-
- +
+
- +
-

- Optional: Enter a subject line for the email. Leave blank for default. -
- Note: You may include {server_name}, {start_date}, and {end_date} as parameters. The global date format under Settings > General will be used. -

-
-
- -
-
- -
-
-

- Optional: Enter a body line for the email. Leave blank for default. -
- Note: You may include {server_name}, {start_date}, and {end_date} as parameters. The global date format under Settings > General will be used. +

Select an existing notification agent where the subject and body text will be sent.
+ Note: Self-hosted newsletters must be enabled under Newsletters to include a link to the newsletter. +

-
+
% for item in newsletter['email_config_options']: % if item['input_type'] == 'help':
@@ -377,12 +418,34 @@ var incl_libraries = $incl_libraries[0].selectize; incl_libraries.setValue(${json.dumps(next((c['value'] for c in newsletter['config_options'] if c['name'] == 'newsletter_config_incl_libraries'), [])) | n}); - $('#newsletter_email_notifier').change(function () { - if ($(this).val() === "0") { + function toggleEmailSelect () { + if ($('#newsletter_config_formatted_checkbox').is(':checked')) { + $('#email_notifier_select').show(); + $('#other_notifier_select').hide(); + toggleNewEmailConfig(); + } else { + $('#email_notifier_select').hide(); + $('#other_notifier_select').show(); + $('#newsletter-email-config').hide(); + } + } + toggleEmailSelect(); + + $('#newsletter_config_formatted_checkbox').change(function () { + toggleEmailSelect(); + }); + + function toggleNewEmailConfig () { + if ($('#newsletter_email_notifier_id').val() === '0') { $('#newsletter-email-config').show(); } else { $('#newsletter-email-config').hide(); } + } + toggleNewEmailConfig(); + + $('#newsletter_email_notifier_id').change(function () { + toggleNewEmailConfig(); }); var REGEX_EMAIL = '([a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@' + diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index c1d09b52..5b1539c1 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1496,6 +1496,53 @@
+