feat: add custom notification support for volume backup status updates

This commit is contained in:
Mauricio Siu
2026-02-25 23:04:13 -06:00
parent 9b4a37eebf
commit 7a25a9f5b4

View File

@@ -5,6 +5,7 @@ import { renderAsync } from "@react-email/components";
import { format } from "date-fns";
import { and, eq } from "drizzle-orm";
import {
sendCustomNotification,
sendDiscordNotification,
sendEmailNotification,
sendGotifyNotification,
@@ -59,6 +60,7 @@ export const sendVolumeBackupNotifications = async ({
ntfy: true,
pushover: true,
teams: true,
custom: true,
},
});
@@ -73,6 +75,7 @@ export const sendVolumeBackupNotifications = async ({
ntfy,
pushover,
teams,
custom,
} = notification;
if (email || resend) {
@@ -323,5 +326,25 @@ export const sendVolumeBackupNotifications = async ({
facts,
});
}
if (custom) {
await sendCustomNotification(custom, {
title: `Volume Backup ${type === "success" ? "Successful" : "Failed"}`,
message:
type === "success"
? "Volume backup completed successfully"
: "Volume backup failed",
projectName,
applicationName,
volumeName,
serviceType,
type,
errorMessage: errorMessage ?? "",
backupSize: backupSize ?? "",
timestamp: date.toISOString(),
date: date.toLocaleString(),
status: type,
});
}
}
};