From 95714c17496752ccfdbe3b9f44d90b74cca694ed Mon Sep 17 00:00:00 2001 From: ChristoferMendes Date: Fri, 26 Sep 2025 17:06:11 -0300 Subject: [PATCH] feat(notifications): implement custom notification for Docker cleanup completion --- .../src/utils/notifications/docker-cleanup.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/server/src/utils/notifications/docker-cleanup.ts b/packages/server/src/utils/notifications/docker-cleanup.ts index 15b1c347a..7897bf92f 100644 --- a/packages/server/src/utils/notifications/docker-cleanup.ts +++ b/packages/server/src/utils/notifications/docker-cleanup.ts @@ -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, @@ -31,11 +32,12 @@ export const sendDockerCleanupNotifications = async ( slack: true, gotify: true, ntfy: true, + custom: true, }, }); for (const notification of notificationList) { - const { email, discord, telegram, slack, gotify, ntfy } = notification; + const { email, discord, telegram, slack, gotify, ntfy, custom } = notification; if (email) { const template = await renderAsync( @@ -135,5 +137,17 @@ export const sendDockerCleanupNotifications = async ( ], }); } + + if (custom) { + await sendCustomNotification(custom, { + title: "Docker Cleanup", + message: "Docker cleanup completed successfully", + cleanupMessage: message, + timestamp: date.toISOString(), + date: date.toLocaleString(), + status: "success", + type: "docker-cleanup", + }); + } } };