Very basic email subject customization

This commit is contained in:
Lukas
2021-10-09 20:32:45 +02:00
parent fc8d1e78b6
commit 5e3ea3293c
3 changed files with 15 additions and 1 deletions

View File

@@ -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,