From dea613fa851d973abeeba5d85b78bb2ab5510c16 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Fri, 17 Jul 2020 16:34:37 +0100 Subject: [PATCH] Add notifications setting to setup page --- jellyfin_accounts/data/static/setup.js | 6 ++++++ jellyfin_accounts/data/templates/setup.html | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/jellyfin_accounts/data/static/setup.js b/jellyfin_accounts/data/static/setup.js index bfb6fdb..266979d 100644 --- a/jellyfin_accounts/data/static/setup.js +++ b/jellyfin_accounts/data/static/setup.js @@ -18,12 +18,15 @@ function checkEmailRadio() { document.getElementById('emailNextButton').href = '#page-5'; document.getElementById('valBackButton').href = '#page-7'; if (document.getElementById('emailSMTPRadio').checked) { + document.getElementById('emailCommonArea').style.display = ''; document.getElementById('emailSMTPArea').style.display = ''; document.getElementById('emailMailgunArea').style.display = 'none'; } else if (document.getElementById('emailMailgunRadio').checked) { + document.getElementById('emailCommonArea').style.display = ''; document.getElementById('emailSMTPArea').style.display = 'none'; document.getElementById('emailMailgunArea').style.display = ''; } else if (document.getElementById('emailDisabledRadio').checked) { + document.getElementById('emailCommonArea').style.display = 'none'; document.getElementById('emailSMTPArea').style.display = 'none'; document.getElementById('emailMailgunArea').style.display = 'none'; document.getElementById('emailNextButton').href = '#page-8'; @@ -140,6 +143,7 @@ document.getElementById('submitButton').onclick = function() { config['invite_emails'] = {}; config['mailgun'] = {}; config['smtp'] = {}; + config['notifications'] = {}; // Page 2: Auth if (document.getElementById('jfAuthRadio').checked) { config['ui']['jellyfin_login'] = 'true'; @@ -151,6 +155,7 @@ document.getElementById('submitButton').onclick = function() { } else { config['ui']['username'] = document.getElementById('manualAuthUsername').value; config['ui']['password'] = document.getElementById('manualAuthPassword').value; + config['ui']['email'] = document.getElementById('manualAuthEmail').value; }; // Page 3: Connect to jellyfin config['jellyfin']['server'] = document.getElementById('jfHost').value; @@ -178,6 +183,7 @@ document.getElementById('submitButton').onclick = function() { config['mailgun']['api_key'] = document.getElementById('emailMailgunKey').value; config['email']['address'] = document.getElementById('emailMailgunAddress').value; }; + config['notifications']['enabled'] = document.getElementById('notificationsEnabled').checked.toString(); // Page 5: Email formatting config['email']['from'] = document.getElementById('emailSender').value; config['email']['date_format'] = document.getElementById('emailDateFormat').value; diff --git a/jellyfin_accounts/data/templates/setup.html b/jellyfin_accounts/data/templates/setup.html index 6dc1edb..4ad2ac3 100644 --- a/jellyfin_accounts/data/templates/setup.html +++ b/jellyfin_accounts/data/templates/setup.html @@ -89,6 +89,11 @@ +
+ + + Your email address is only required if you want to recieve activity notifications. +

@@ -180,6 +185,15 @@
+
+
Notifications
+

Enabling notifications will allow you to choose (per-invite) to recieve emails when an invite expires, or when a new user is created. If you chose to use Manual auth instead of Jellyfin auth previously, make sure you provided an email address.

+
+ + + +
+

Back