% if newsletter: <%! import json from plexpy import helpers, notifiers 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']})

Enable the newsletter
Schedule

Set the schedule for 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
Description

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

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.

Send newsletter as a 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.

Email Notification Agent

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

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
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 the newsletter to all users in your email configuration!

% else:

#### Error

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