diff --git a/server/notification-providers/smtp.js b/server/notification-providers/smtp.js index 9f3defa5e..35d714f0c 100644 --- a/server/notification-providers/smtp.js +++ b/server/notification-providers/smtp.js @@ -44,6 +44,7 @@ class SMTP extends NotificationProvider { // default values in case the user does not want to template let subject = msg; let body = msg; + let use_html_body = false if (heartbeatJSON) { body = `${msg}\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`; } @@ -52,7 +53,7 @@ class SMTP extends NotificationProvider { // cannot end with whitespace as this often raises spam scores const customSubject = notification.customSubject?.trim() || ""; const customBody = notification.customBody?.trim() || ""; - + use_html_body = notification.htmlBody || false const context = this.generateContext(msg, monitorJSON, heartbeatJSON); const engine = new Liquid(); if (customSubject !== "") { @@ -73,7 +74,7 @@ class SMTP extends NotificationProvider { bcc: notification.smtpBCC, to: notification.smtpTo, subject: subject, - text: body, + [htmlBody ? 'html' : 'text']: body }); return okMsg;