Merge pull request #3802 from Dokploy/3768-volume-backup-custom-webhook-notifications-not-working

feat: add custom notification support for volume backup status updates
This commit is contained in:
Mauricio Siu
2026-02-25 23:05:06 -06:00
committed by GitHub

View File

@@ -5,6 +5,7 @@ import { renderAsync } from "@react-email/components";
import { format } from "date-fns"; import { format } from "date-fns";
import { and, eq } from "drizzle-orm"; import { and, eq } from "drizzle-orm";
import { import {
sendCustomNotification,
sendDiscordNotification, sendDiscordNotification,
sendEmailNotification, sendEmailNotification,
sendGotifyNotification, sendGotifyNotification,
@@ -59,6 +60,7 @@ export const sendVolumeBackupNotifications = async ({
ntfy: true, ntfy: true,
pushover: true, pushover: true,
teams: true, teams: true,
custom: true,
}, },
}); });
@@ -73,6 +75,7 @@ export const sendVolumeBackupNotifications = async ({
ntfy, ntfy,
pushover, pushover,
teams, teams,
custom,
} = notification; } = notification;
if (email || resend) { if (email || resend) {
@@ -323,5 +326,25 @@ export const sendVolumeBackupNotifications = async ({
facts, 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,
});
}
} }
}; };