diff --git a/apps/dokploy/server/api/routers/auth.ts b/apps/dokploy/server/api/routers/auth.ts
index a1345cca3..b02ab617c 100644
--- a/apps/dokploy/server/api/routers/auth.ts
+++ b/apps/dokploy/server/api/routers/auth.ts
@@ -363,7 +363,7 @@ export const authRouter = createTRPCRouter({
Reset Password
-
+
`,
);
}),
@@ -505,7 +505,7 @@ export const sendDiscordNotificationWelcome = async (newAdmin: Auth) => {
webhookUrl: process.env.DISCORD_WEBHOOK_URL || "",
},
{
- title: " New User Registered",
+ title: "New User Registered",
color: 0x00ff00,
fields: [
{
diff --git a/apps/dokploy/server/api/routers/notification.ts b/apps/dokploy/server/api/routers/notification.ts
index 951d2a10d..ba226d457 100644
--- a/apps/dokploy/server/api/routers/notification.ts
+++ b/apps/dokploy/server/api/routers/notification.ts
@@ -187,11 +187,15 @@ export const notificationRouter = createTRPCRouter({
.input(apiTestDiscordConnection)
.mutation(async ({ input }) => {
try {
+ const decorate = (decoration: string, text: string) =>
+ `${input.decoration ? decoration : ""} ${text}`.trim();
+
await sendDiscordNotification(input, {
- title: "> `๐ค` - Test Notification",
- description: "> Hi, From Dokploy ๐",
+ title: decorate(">", "`๐ค` - Test Notification"),
+ description: decorate(">", "Hi, From Dokploy ๐"),
color: 0xf3f7f4,
});
+
return true;
} catch (error) {
throw new TRPCError({
diff --git a/packages/server/src/utils/notifications/build-error.ts b/packages/server/src/utils/notifications/build-error.ts
index f9286fc7f..695b37863 100644
--- a/packages/server/src/utils/notifications/build-error.ts
+++ b/packages/server/src/utils/notifications/build-error.ts
@@ -59,46 +59,49 @@ export const sendBuildErrorNotifications = async ({
}
if (discord) {
+ const decorate = (decoration: string, text: string) =>
+ `${discord.decoration ? decoration : ""} ${text}`.trim();
+
await sendDiscordNotification(discord, {
- title: "> `โ ๏ธ` Build Failed",
+ title: decorate(">", "`โ ๏ธ` Build Failed"),
color: 0xed4245,
fields: [
{
- name: "`๐ ๏ธ` Project",
+ name: decorate("`๐ ๏ธ`", "Project"),
value: projectName,
inline: true,
},
{
- name: "`โ๏ธ` Application",
+ name: decorate("`โ๏ธ`", "Application"),
value: applicationName,
inline: true,
},
{
- name: "`โ` Type",
+ name: decorate("`โ`", "Type"),
value: applicationType,
inline: true,
},
{
- name: "`๐
` Date",
+ name: decorate("`๐
`", "Date"),
value: ``,
inline: true,
},
{
- name: "`โ` Time",
+ name: decorate("`โ`", "Time"),
value: ``,
inline: true,
},
{
- name: "`โ`Type",
+ name: decorate("`โ`", "Type"),
value: "Failed",
inline: true,
},
{
- name: "`โ ๏ธ` Error Message",
+ name: decorate("`โ ๏ธ`", "Error Message"),
value: `\`\`\`${errorMessage}\`\`\``,
},
{
- name: "`๐งท` Build Link",
+ name: decorate("`๐งท`", "Build Link"),
value: `[Click here to access build link](${buildLink})`,
},
],
@@ -114,15 +117,15 @@ export const sendBuildErrorNotifications = async ({
telegram,
`
โ ๏ธ Build Failed
-
+
Project: ${projectName}
Application: ${applicationName}
Type: ${applicationType}
Time: ${date.toLocaleString()}
-
+
Error:
${errorMessage}
-
+
Build Details: ${buildLink}
`,
);
diff --git a/packages/server/src/utils/notifications/build-success.ts b/packages/server/src/utils/notifications/build-success.ts
index 97fe7e1cf..402b0cd2c 100644
--- a/packages/server/src/utils/notifications/build-success.ts
+++ b/packages/server/src/utils/notifications/build-success.ts
@@ -57,42 +57,45 @@ export const sendBuildSuccessNotifications = async ({
}
if (discord) {
+ const decorate = (decoration: string, text: string) =>
+ `${discord.decoration ? decoration : ""} ${text}`.trim();
+
await sendDiscordNotification(discord, {
title: "> `โ
` Build Success",
color: 0x57f287,
fields: [
{
- name: "`๐ ๏ธ` Project",
+ name: decorate("`๐ ๏ธ`", "Project"),
value: projectName,
inline: true,
},
{
- name: "`โ๏ธ` Application",
+ name: decorate("`โ๏ธ`", "Application"),
value: applicationName,
inline: true,
},
{
- name: "`โ` Application Type",
+ name: decorate("`โ`", "Type"),
value: applicationType,
inline: true,
},
{
- name: "`๐
` Date",
+ name: decorate("`๐
`", "Date"),
value: ``,
inline: true,
},
{
- name: "`โ` Time",
+ name: decorate("`โ`", "Time"),
value: ``,
inline: true,
},
{
- name: "`โ` Type",
+ name: decorate("`โ`", "Type"),
value: "Successful",
inline: true,
},
{
- name: "`๐งท` Build Link",
+ name: decorate("`๐งท`", "Build Link"),
value: `[Click here to access build link](${buildLink})`,
},
],
@@ -108,12 +111,12 @@ export const sendBuildSuccessNotifications = async ({
telegram,
`
โ
Build Success
-
+
Project: ${projectName}
Application: ${applicationName}
Type: ${applicationType}
Time: ${date.toLocaleString()}
-
+
Build Details: ${buildLink}
`,
);
diff --git a/packages/server/src/utils/notifications/database-backup.ts b/packages/server/src/utils/notifications/database-backup.ts
index d2dccdafa..3aec6f3d3 100644
--- a/packages/server/src/utils/notifications/database-backup.ts
+++ b/packages/server/src/utils/notifications/database-backup.ts
@@ -62,40 +62,43 @@ export const sendDatabaseBackupNotifications = async ({
}
if (discord) {
+ const decorate = (decoration: string, text: string) =>
+ `${discord.decoration ? decoration : ""} ${text}`.trim();
+
await sendDiscordNotification(discord, {
title:
type === "success"
- ? "> `โ
` Database Backup Successful"
- : "> `โ` Database Backup Failed",
+ ? decorate(">", "`โ
` Database Backup Successful")
+ : decorate(">", "`โ` Database Backup Failed"),
color: type === "success" ? 0x57f287 : 0xed4245,
fields: [
{
- name: "`๐ ๏ธ` Project",
+ name: decorate("`๐ ๏ธ`", "Project"),
value: projectName,
inline: true,
},
{
- name: "`โ๏ธ` Application",
+ name: decorate("`โ๏ธ`", "Application"),
value: applicationName,
inline: true,
},
{
- name: "`โ` Database",
+ name: decorate("`โ`", "Database"),
value: databaseType,
inline: true,
},
{
- name: "`๐
` Date",
+ name: decorate("`๐
`", "Date"),
value: ``,
inline: true,
},
{
- name: "`โ` Time",
+ name: decorate("`โ`", "Time"),
value: ``,
inline: true,
},
{
- name: "`โ` Type",
+ name: decorate("`โ`", "Type"),
value: type
.replace("error", "Failed")
.replace("success", "Successful"),
@@ -104,7 +107,7 @@ export const sendDatabaseBackupNotifications = async ({
...(type === "error" && errorMessage
? [
{
- name: "`โ ๏ธ` Error Message",
+ name: decorate("`โ ๏ธ`", "Error Message"),
value: `\`\`\`${errorMessage}\`\`\``,
},
]
@@ -121,12 +124,12 @@ export const sendDatabaseBackupNotifications = async ({
const statusEmoji = type === "success" ? "โ
" : "โ";
const messageText = `
${statusEmoji} Database Backup ${type === "success" ? "Successful" : "Failed"}
-
+
Project: ${projectName}
Application: ${applicationName}
Type: ${databaseType}
Time: ${date.toLocaleString()}
-
+
Status: ${type === "success" ? "Successful" : "Failed"}
${type === "error" && errorMessage ? `Error: ${errorMessage}` : ""}
`;
diff --git a/packages/server/src/utils/notifications/docker-cleanup.ts b/packages/server/src/utils/notifications/docker-cleanup.ts
index 515d1ddc4..c95c79067 100644
--- a/packages/server/src/utils/notifications/docker-cleanup.ts
+++ b/packages/server/src/utils/notifications/docker-cleanup.ts
@@ -45,27 +45,30 @@ export const sendDockerCleanupNotifications = async (
}
if (discord) {
+ const decorate = (decoration: string, text: string) =>
+ `${discord.decoration ? decoration : ""} ${text}`.trim();
+
await sendDiscordNotification(discord, {
- title: "> `โ
` Docker Cleanup",
+ title: decorate(">", "`โ
` Docker Cleanup"),
color: 0x57f287,
fields: [
{
- name: "`๐
` Date",
+ name: decorate("`๐
`", "Date"),
value: ``,
inline: true,
},
{
- name: "`โ` Time",
+ name: decorate("`โ`", "Time"),
value: ``,
inline: true,
},
{
- name: "`โ` Type",
+ name: decorate("`โ`", "Type"),
value: "Successful",
inline: true,
},
{
- name: "`๐` Message",
+ name: decorate("`๐`", "Message"),
value: `\`\`\`${message}\`\`\``,
},
],
diff --git a/packages/server/src/utils/notifications/dokploy-restart.ts b/packages/server/src/utils/notifications/dokploy-restart.ts
index 883a3d1f1..16170349b 100644
--- a/packages/server/src/utils/notifications/dokploy-restart.ts
+++ b/packages/server/src/utils/notifications/dokploy-restart.ts
@@ -34,22 +34,25 @@ export const sendDokployRestartNotifications = async () => {
}
if (discord) {
+ const decorate = (decoration: string, text: string) =>
+ `${discord.decoration ? decoration : ""} ${text}`.trim();
+
await sendDiscordNotification(discord, {
- title: "> `โ
` Dokploy Server Restarted",
+ title: decorate(">", "`โ
` Dokploy Server Restarted"),
color: 0x57f287,
fields: [
{
- name: "`๐
` Date",
+ name: decorate("`๐
`", "Date"),
value: ``,
inline: true,
},
{
- name: "`โ` Time",
+ name: decorate("`โ`", "Time"),
value: ``,
inline: true,
},
{
- name: "`โ` Type",
+ name: decorate("`โ`", "Type"),
value: "Successful",
inline: true,
},