mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-02-23 03:55:56 +00:00
changed smtp to allow for html bodies
This commit is contained in:
parent
b45dc6787d
commit
acb99487f8
1 changed files with 3 additions and 2 deletions
|
@ -44,6 +44,7 @@ class SMTP extends NotificationProvider {
|
||||||
// default values in case the user does not want to template
|
// default values in case the user does not want to template
|
||||||
let subject = msg;
|
let subject = msg;
|
||||||
let body = msg;
|
let body = msg;
|
||||||
|
let use_html_body = false
|
||||||
if (heartbeatJSON) {
|
if (heartbeatJSON) {
|
||||||
body = `${msg}\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`;
|
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
|
// cannot end with whitespace as this often raises spam scores
|
||||||
const customSubject = notification.customSubject?.trim() || "";
|
const customSubject = notification.customSubject?.trim() || "";
|
||||||
const customBody = notification.customBody?.trim() || "";
|
const customBody = notification.customBody?.trim() || "";
|
||||||
|
use_html_body = notification.htmlBody || false
|
||||||
const context = this.generateContext(msg, monitorJSON, heartbeatJSON);
|
const context = this.generateContext(msg, monitorJSON, heartbeatJSON);
|
||||||
const engine = new Liquid();
|
const engine = new Liquid();
|
||||||
if (customSubject !== "") {
|
if (customSubject !== "") {
|
||||||
|
@ -73,7 +74,7 @@ class SMTP extends NotificationProvider {
|
||||||
bcc: notification.smtpBCC,
|
bcc: notification.smtpBCC,
|
||||||
to: notification.smtpTo,
|
to: notification.smtpTo,
|
||||||
subject: subject,
|
subject: subject,
|
||||||
text: body,
|
[htmlBody ? 'html' : 'text']: body
|
||||||
});
|
});
|
||||||
|
|
||||||
return okMsg;
|
return okMsg;
|
||||||
|
|
Loading…
Add table
Reference in a new issue