From 4aeafdae2d4b6f0f411cd64da70498d83ed7d7b6 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 24 Mar 2018 14:34:47 -0700 Subject: [PATCH] Add custom body line to formatted email --- .../interfaces/default/newsletter_config.html | 22 ++++++++++++++----- data/interfaces/default/settings.html | 4 ++-- .../newsletters/recently_added.html | 18 ++++++++++++--- .../newsletters/recently_added_master.html | 18 ++++++++++++--- plexpy/newsletters.py | 7 +++--- plexpy/notification_handler.py | 8 +++---- plexpy/webserve.py | 4 +++- 7 files changed, 59 insertions(+), 22 deletions(-) diff --git a/data/interfaces/default/newsletter_config.html b/data/interfaces/default/newsletter_config.html index aa73649e..b92fe3ad 100644 --- a/data/interfaces/default/newsletter_config.html +++ b/data/interfaces/default/newsletter_config.html @@ -3,9 +3,8 @@ import json from plexpy import helpers, notifiers - all_notifiers = notifiers.get_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'] - 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 %> @@ -161,6 +160,10 @@ 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. +

@@ -171,19 +174,18 @@

- Optional: Enter a subject line for the newsletter. Leave blank for default. + Enter a custom 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. + Enter a custom body line for the newsletter.

@@ -638,6 +640,14 @@ } }); + // auto resizing textarea for custom notification message body + $('textarea[data-autoresize]').each(function () { + var offset = this.offsetHeight - this.clientHeight; + var resizeTextarea = function (el) { + $(el).css('height', 'auto').css('height', el.scrollHeight + offset); + }; + $(this).on('focus keyup input', function () { resizeTextarea(this); }).removeAttr('data-autoresize'); + }); % else: