mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-02-22 19:45:56 +00:00
only apply html for custom bodies
This commit is contained in:
parent
c72adaf585
commit
3fa33c87d9
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Add table
Reference in a new issue