diff --git a/server/notification-providers/ntfy.js b/server/notification-providers/ntfy.js index 3288d8fb7..64064f57d 100644 --- a/server/notification-providers/ntfy.js +++ b/server/notification-providers/ntfy.js @@ -7,15 +7,18 @@ class Ntfy extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { let okMsg = "Sent Successfully."; - try { - await axios.post(`${notification.ntfyserverurl}`, { + var ntfyparams = { "topic": notification.ntfytopic, "message": msg, "priority": notification.ntfyPriority || 4, "title": "Uptime-Kuma", - "icon": notification.ntfyIcon || "", - }); + }; + if (notification.ntfyIcon) { + ntfyparams.icon = notification.ntfyIcon; + } + try { + await axios.post(`${notification.ntfyserverurl}`, ntfyparams); return okMsg; } catch (error) { diff --git a/src/components/notifications/Ntfy.vue b/src/components/notifications/Ntfy.vue index 4728f8911..5764429f6 100644 --- a/src/components/notifications/Ntfy.vue +++ b/src/components/notifications/Ntfy.vue @@ -19,7 +19,7 @@
- +