only apply html for custom bodies

This commit is contained in:
youpie 2025-02-19 23:56:28 +01:00
parent c72adaf585
commit 3fa33c87d9
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,6 @@ 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 !== "") {
@ -61,6 +60,7 @@ class SMTP extends NotificationProvider {
subject = await engine.render(tpl, context); subject = await engine.render(tpl, context);
} }
if (customBody !== "") { if (customBody !== "") {
use_html_body = notification.htmlBody || false
const tpl = engine.parse(customBody); const tpl = engine.parse(customBody);
body = await engine.render(tpl, context); body = await engine.render(tpl, context);
} }

View file

@ -93,7 +93,7 @@
<div class="form-check"> <div class="form-check">
<input id="use-html-body" v-model="$parent.notification.htmlBody" class="form-check-input" type="checkbox" value=""> <input id="use-html-body" v-model="$parent.notification.htmlBody" class="form-check-input" type="checkbox" value="">
<label class="form-check-label" for="use-html-body"> <label class="form-check-label" for="use-html-body">
{{ $t("Use HTML E-mail body") }} {{ $t("Use HTML for custom E-mail body") }}
</label> </label>
</div> </div>
</div> </div>