diff --git a/server/notification-providers/smtp.js b/server/notification-providers/smtp.js index ecb583eb7..e5fd53e46 100644 --- a/server/notification-providers/smtp.js +++ b/server/notification-providers/smtp.js @@ -20,6 +20,14 @@ class SMTP extends NotificationProvider { pass: notification.smtpPassword, }; } + // Lets start with default subject + let subject = msg; + // Our subject cannot end with whitespace it's often raise spam score + let customsubject = notification.customsubject.trim() + // If custom subject is not empty, change subject for notification + if (customsubject !== "") { + subject = customsubject + } let transporter = nodemailer.createTransport(config); @@ -34,7 +42,7 @@ class SMTP extends NotificationProvider { cc: notification.smtpCC, bcc: notification.smtpBCC, to: notification.smtpTo, - subject: msg, + subject: subject, text: bodyTextContent, tls: { rejectUnauthorized: notification.smtpIgnoreTLSError || false, diff --git a/src/components/notifications/SMTP.vue b/src/components/notifications/SMTP.vue index 72934cdaf..165d39c67 100644 --- a/src/components/notifications/SMTP.vue +++ b/src/components/notifications/SMTP.vue @@ -43,6 +43,11 @@ +