feat(notifications): implement custom notification for Docker cleanup completion

This commit is contained in:
ChristoferMendes
2025-09-26 17:06:11 -03:00
parent a181b7b8b8
commit 95714c1749

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,
@@ -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",
});
}
}
};