[fix] notification:kind
This commit is contained in:
parent
18327a8db2
commit
2b2f04332b
|
|
@ -85,11 +85,9 @@ namespace _heimdall.notification_kinds.email
|
||||||
info : any
|
info : any
|
||||||
) : Promise<void>
|
) : Promise<void>
|
||||||
{
|
{
|
||||||
const nm_nodemailer = require("nodemailer");
|
const nm_nodemailer = require("nodemailer");
|
||||||
|
|
||||||
// datetime = _datetime.datetime.utcnow()
|
|
||||||
const now : Date = new Date(Date.now());
|
|
||||||
|
|
||||||
|
const now : Date = new Date(Date.now());
|
||||||
const transporter = nm_nodemailer.createTransport(
|
const transporter = nm_nodemailer.createTransport(
|
||||||
{
|
{
|
||||||
"host": parameters.access.host,
|
"host": parameters.access.host,
|
||||||
|
|
@ -111,7 +109,7 @@ namespace _heimdall.notification_kinds.email
|
||||||
"tags": (
|
"tags": (
|
||||||
parameters.tags
|
parameters.tags
|
||||||
.concat([_heimdall.condition_show(state.condition)])
|
.concat([_heimdall.condition_show(state.condition)])
|
||||||
.map(tag => lib_plankton.string.coin("[{{tag}}]", tag.toUpperCase()))
|
.map(tag => lib_plankton.string.coin("[{{tag}}]", {"tag": tag.toUpperCase()}))
|
||||||
.join(" ")
|
.join(" ")
|
||||||
),
|
),
|
||||||
"title": check.name,
|
"title": check.name,
|
||||||
|
|
@ -119,23 +117,11 @@ namespace _heimdall.notification_kinds.email
|
||||||
),
|
),
|
||||||
"text": JSON.stringify(info, undefined, "\t"),
|
"text": JSON.stringify(info, undefined, "\t"),
|
||||||
"headers": {
|
"headers": {
|
||||||
"Date": lib_plankton.string.coin(
|
"Date": now.toUTCString(),
|
||||||
"{{day_of_week}}, {{day_of_month}} {{month}} {{year}} {{hour}}:{{minute}}:{{second}} {{time_offset}}",
|
|
||||||
{
|
|
||||||
"day_of_week": now.getDay().toFixed(0),
|
|
||||||
"day_of_month": now.getDate().toFixed(0),
|
|
||||||
"month": (now.getMonth() + 1).toFixed(0),
|
|
||||||
"year": now.getFullYear().toFixed(0),
|
|
||||||
"hour": now.getHours().toFixed(0),
|
|
||||||
"minute": now.getMinutes().toFixed(0),
|
|
||||||
"second": now.getSeconds().toFixed(0),
|
|
||||||
// "time_offset": (now.getTimezoneOffset() / 60).toFixed(0),
|
|
||||||
"time_offset": "+0000",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue