From acb99487f853f99b170ec44bcc00afc161215480 Mon Sep 17 00:00:00 2001 From: youpie Date: Wed, 19 Feb 2025 23:37:13 +0100 Subject: [PATCH] changed smtp to allow for html bodies --- server/notification-providers/smtp.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;