mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-24 10:39:40 -06:00
Fixed error not sending the email.
This commit is contained in:
@@ -90,11 +90,11 @@ CheckSchema.pre("save", async function (next) {
|
||||
if (monitor.status === true && this.status === false) {
|
||||
// Notify users that the monitor is down
|
||||
for (const notification of notifications) {
|
||||
if (notification.email) {
|
||||
if (notification.type === "email") {
|
||||
await emailService.buildAndSendEmail(
|
||||
"serverIsDownTemplate",
|
||||
{ monitorName: monitor.name, monitorUrl: monitor.url },
|
||||
notification.email,
|
||||
notification.address,
|
||||
`Monitor ${monitor.name} is down`
|
||||
);
|
||||
}
|
||||
@@ -104,11 +104,11 @@ CheckSchema.pre("save", async function (next) {
|
||||
if (monitor.status === false && this.status === true) {
|
||||
// Notify users that the monitor is up
|
||||
for (const notification of notifications) {
|
||||
if (notification.email) {
|
||||
if (notification.type === "email") {
|
||||
await emailService.buildAndSendEmail(
|
||||
"serverIsUpTemplate",
|
||||
{ monitorName: monitor.name, monitorUrl: monitor.url },
|
||||
notification.email,
|
||||
notification.address,
|
||||
`Monitor ${monitor.name} is back up`
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user