From 0e6ec58a83130cc4056b1797b29e13bc4c9d4ddf Mon Sep 17 00:00:00 2001 From: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com> Date: Sun, 14 Nov 2021 21:49:49 +0000 Subject: [PATCH] New: Placeholders in notification fields --- .../Notifications/Email/EmailSettings.cs | 12 +++++------- .../Notifications/PushBullet/PushBulletSettings.cs | 4 ++-- .../Notifications/Pushover/PushoverSettings.cs | 5 +++-- .../Notifications/SendGrid/SendGridSettings.cs | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs b/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs index acd42e99a..3601f3e01 100644 --- a/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs +++ b/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs @@ -32,15 +32,13 @@ namespace NzbDrone.Core.Notifications.Email public EmailSettings() { - Server = "smtp.gmail.com"; Port = 587; - To = Array.Empty(); CC = Array.Empty(); Bcc = Array.Empty(); } - [FieldDefinition(0, Label = "Server", HelpText = "Hostname or IP of Email server")] + [FieldDefinition(0, Label = "Server", HelpText = "Hostname or IP of Email server", Placeholder = "smtp.gmail.com")] public string Server { get; set; } [FieldDefinition(1, Label = "Port")] @@ -55,16 +53,16 @@ namespace NzbDrone.Core.Notifications.Email [FieldDefinition(4, Label = "Password", HelpText = "Password", Type = FieldType.Password, Privacy = PrivacyLevel.Password)] public string Password { get; set; } - [FieldDefinition(5, Label = "From Address")] + [FieldDefinition(5, Label = "From Address", Placeholder = "example@email.com")] public string From { get; set; } - [FieldDefinition(6, Label = "Recipient Address(es)", HelpText = "Comma separated list of email recipients")] + [FieldDefinition(6, Label = "Recipient Address(es)", HelpText = "Comma separated list of email recipients", Placeholder = "example@email.com,example1@email.com")] public IEnumerable To { get; set; } - [FieldDefinition(7, Label = "CC Address(es)", HelpText = "Comma separated list of email cc recipients", Advanced = true)] + [FieldDefinition(7, Label = "CC Address(es)", HelpText = "Comma separated list of email cc recipients", Placeholder = "example@email.com,example1@email.com", Advanced = true)] public IEnumerable CC { get; set; } - [FieldDefinition(8, Label = "BCC Address(es)", HelpText = "Comma separated list of email bcc recipients", Advanced = true)] + [FieldDefinition(8, Label = "BCC Address(es)", HelpText = "Comma separated list of email bcc recipients", Placeholder = "example@email.com,example1@email.com", Advanced = true)] public IEnumerable Bcc { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs index d4e9d0661..93ec03a38 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs @@ -28,10 +28,10 @@ namespace NzbDrone.Core.Notifications.PushBullet [FieldDefinition(0, Label = "Access Token", Privacy = PrivacyLevel.ApiKey, HelpLink = "https://www.pushbullet.com/#settings/account")] public string ApiKey { get; set; } - [FieldDefinition(1, Label = "Device IDs", HelpText = "List of device IDs (leave blank to send to all devices)", Type = FieldType.Device)] + [FieldDefinition(1, Label = "Device IDs", HelpText = "List of device IDs (leave blank to send to all devices)", Type = FieldType.Device, Placeholder = "123456789,987654321")] public IEnumerable DeviceIds { get; set; } - [FieldDefinition(2, Label = "Channel Tags", HelpText = "List of Channel Tags to send notifications to", Type = FieldType.Tag)] + [FieldDefinition(2, Label = "Channel Tags", HelpText = "List of Channel Tags to send notifications to", Type = FieldType.Tag, Placeholder = "Channel1234,Channel4321")] public IEnumerable ChannelTags { get; set; } [FieldDefinition(3, Label = "Sender ID", HelpText = "The device ID to send notifications from, use device_iden in the device's URL on pushbullet.com (leave blank to send from yourself)")] diff --git a/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs b/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs index dcfa5bcfd..3d573be78 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using FluentValidation; using NzbDrone.Core.Annotations; @@ -23,7 +24,7 @@ namespace NzbDrone.Core.Notifications.Pushover public PushoverSettings() { Priority = 0; - Devices = System.Array.Empty(); + Devices = Array.Empty(); } //TODO: Get Pushover to change our app name (or create a new app) when we have a new logo @@ -33,7 +34,7 @@ namespace NzbDrone.Core.Notifications.Pushover [FieldDefinition(1, Label = "User Key", Privacy = PrivacyLevel.UserName, HelpLink = "https://pushover.net/")] public string UserKey { get; set; } - [FieldDefinition(2, Label = "Devices", HelpText = "List of device names (leave blank to send to all devices)", Type = FieldType.Tag)] + [FieldDefinition(2, Label = "Devices", HelpText = "List of device names (leave blank to send to all devices)", Type = FieldType.Tag, Placeholder = "device1")] public IEnumerable Devices { get; set; } [FieldDefinition(3, Label = "Priority", Type = FieldType.Select, SelectOptions = typeof(PushoverPriority))] diff --git a/src/NzbDrone.Core/Notifications/SendGrid/SendGridSettings.cs b/src/NzbDrone.Core/Notifications/SendGrid/SendGridSettings.cs index 63f30d4ec..fa9ef39ae 100644 --- a/src/NzbDrone.Core/Notifications/SendGrid/SendGridSettings.cs +++ b/src/NzbDrone.Core/Notifications/SendGrid/SendGridSettings.cs @@ -36,7 +36,7 @@ namespace NzbDrone.Core.Notifications.SendGrid [FieldDefinition(2, Label = "From Address")] public string From { get; set; } - [FieldDefinition(3, Label = "Recipient Address(es)", Type = FieldType.Tag)] + [FieldDefinition(3, Label = "Recipient Address(es)", Type = FieldType.Tag, Placeholder = "example@email.com,example1@email.com")] public IEnumerable Recipients { get; set; } public NzbDroneValidationResult Validate()