Skip to content

Open-source status page, incident response and uptime monitoring

πŸ› alerting (#776)

Thibault Le Ouay97341053123e
diff --git a/apps/server/src/checker/alerting.ts b/apps/server/src/checker/alerting.ts
index d7a106f93..ce597a422 100644
--- a/apps/server/src/checker/alerting.ts
+++ b/apps/server/src/checker/alerting.ts
@@ -38,7 +38,7 @@ export const triggerNotifications = async ({
.all();
for (const notif of notifications) {
console.log(
- `πŸ’Œ sending notification for ${monitorId} and chanel ${notif.notification.provider}`,
+ `πŸ’Œ sending notification for ${monitorId} and chanel ${notif.notification.provider} for ${notifType}`,
);
const monitor = selectMonitorSchema.parse(notif.monitor);
switch (notifType) {
diff --git a/packages/notifications/email/src/index.ts b/packages/notifications/email/src/index.ts
index 38ff13480..ff7c1d4cc 100644
--- a/packages/notifications/email/src/index.ts
+++ b/packages/notifications/email/src/index.ts
@@ -26,7 +26,7 @@ export const sendAlert = async ({
},
body: JSON.stringify({
to: email,
- from: "Notifications <[email protected]>",
+ from: "Notifications <[email protected]>",
subject: `Your monitor ${monitor.name} is down 🚨`,
html: `<p>Hi,<br><br>Your monitor ${monitor.name} is down. </p><p>URL : ${
@@ -44,6 +44,9 @@ export const sendAlert = async ({
console.log(data);
// return NextResponse.json(data);
}
+ if (!res.ok) {
+ console.log(`Error sending recovery email ${monitor.id}`);
+ }
};
export const sendRecovery = async ({
@@ -81,4 +84,7 @@ export const sendRecovery = async ({
console.log(data);
// return NextResponse.json(data);
}
+ if (!res.ok) {
+ console.log(`Error sending recovery email ${monitor.id}`);
+ }
};