mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-16 19:35:25 +02:00
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:
@@ -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,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user