% if newsletter: <%! import json from plexpy import notifiers from plexpy.helpers import anon_url, checked all_notifiers = sorted(notifiers.get_notifiers(), key=lambda k: (k['agent_label'].lower(), k['friendly_name'], k['id'])) email_notifiers = [n for n in all_notifiers if n['agent_name'] == 'email'] 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 %>

#### ${newsletter['agent_label']} Newsletter Settings (Newsletter ID: ${newsletter['id']}${' - ' + newsletter['friendly_name'] if newsletter['friendly_name'] else ''})

Enable the Newsletter
Schedule

Set the schedule for the newsletter. Set the schedule for the newsletter using a custom crontab. Click here for a list of supported expressions.

Time Frame
Last

Set the time frame to include in the newsletter.

% for item in newsletter['config_options']: % if item['input_type'] == 'help':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'text' or item['input_type'] == 'password':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'number':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'button':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'checkbox':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'select':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'selectize':
${item['label']}

${item['description'] | n}

% endif % endfor
Unique ID Name

Optional: Enter a unique ID name to create a static URL to the last sent scheduled newsletter at ${http_root}newsletter/id/<id_name>. Only letters (a-z), numbers (0-9), underscores (_) and hyphens (-) are allowed. Leave blank to disable.
Note: Test newsletters are not considered scheduled newsletters.

Description

Optional: Enter a description to help identify this newsletter in the newsletters list.

Saving
Save HTML File Only

Enable to save the newsletter HTML file without sending it to any notification agent.

HTML File Name

Optional: Enter the file name to use when saving the newsletter (ending with .html). You may use any of the newsletter text parameters. Leave blank for default.

Sending
Send Newsletter as an HTML Formatted Email

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

Enable Grouped Email Thread

Enable to group this newsletter together in a single Email thread. Disable to send a new Email for each newsletter.

Email Notification Agent

Select an existing Email notification agent or enter a new configuration below.
Note: Make sure HTML support is enabled for the Email notification agent.

Notification Agent

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':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'text' or item['input_type'] == 'password':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'number':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'button':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'checkbox' and item['name'] != 'newsletter_email_html_support':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'select':
${item['label']}

${item['description'] | n}

% elif item['input_type'] == 'selectize':
${item['label']}

${item['description'] | n}

% endif % endfor
Newsletter Text

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

You can also add text modifiers to change the case or slice parameters with a list of items. Click here to view usage information.

Subject

Enter a custom subject line for the newsletter. Leave blank for default.

Body
${newsletter['body']}

Enter a custom body line for the newsletter notification. Leave blank for default.

Message
${newsletter['message']}

Enter a custom message to include on the newsletter. Supports HTML with syntax highlighting.

Preview Newsletter

Preview the ${newsletter['agent_label']} newsletter.

Test Newsletter

Test if the ${newsletter['agent_label']} newsletter is working. Check the logs for troubleshooting.

Warning: This will send an actual newsletter to your notification agent!

% else:

#### Error

Failed to retrieve newsletter configuration. Check the logs for more info.
% endif