diff --git a/docs/using-seerr/notifications/ntfy.md b/docs/using-seerr/notifications/ntfy.md index 6aa4664923..2b153a2f94 100644 --- a/docs/using-seerr/notifications/ntfy.md +++ b/docs/using-seerr/notifications/ntfy.md @@ -16,6 +16,10 @@ Set this to the URL of your ntfy.sh server. Set this to the topic you want to send notifications to. +### Tags (optional) + +Set this to a comma-separated list of [ntfy tags](https://docs.ntfy.sh/publish/#tags-emojis) to apply to notifications (for example, `eyes` or `eyes,warning`). + ### Username + Password authentication (optional) Set this to the username and password for your ntfy.sh server. diff --git a/seerr-api.yml b/seerr-api.yml index f691df2905..1d3f526476 100644 --- a/seerr-api.yml +++ b/seerr-api.yml @@ -1554,6 +1554,8 @@ components: type: string topic: type: string + tags: + type: string authMethodUsernamePassword: type: boolean username: diff --git a/server/lib/notifications/agents/ntfy.ts b/server/lib/notifications/agents/ntfy.ts index fae329a007..c9efcbe2f6 100644 --- a/server/lib/notifications/agents/ntfy.ts +++ b/server/lib/notifications/agents/ntfy.ts @@ -35,6 +35,10 @@ class NtfyAgent const embedPoster = settings.embedPoster; const topic = settings.options.topic; + const tags = settings.options.tags + ?.split(',') + .map((tag) => tag.trim()) + .filter((tag) => tag.length > 0); const priority = settings.options.priority ?? 3; const title = payload.event @@ -102,6 +106,9 @@ class NtfyAgent message, markdown: true, }; + if (tags && tags.length > 0) { + ntfyPayload.tags = tags; + } if (attach) { ntfyPayload.attach = attach; } diff --git a/server/lib/settings/index.ts b/server/lib/settings/index.ts index 0a896524eb..9e2538c189 100644 --- a/server/lib/settings/index.ts +++ b/server/lib/settings/index.ts @@ -312,6 +312,7 @@ export interface NotificationAgentNtfy extends NotificationAgentConfig { options: { url: string; topic: string; + tags?: string; authMethodUsernamePassword?: boolean; username?: string; password?: string; @@ -563,6 +564,7 @@ class Settings { options: { url: '', topic: '', + tags: '', priority: 3, locale: 'en', }, diff --git a/src/components/Settings/Notifications/NotificationsNtfy/index.tsx b/src/components/Settings/Notifications/NotificationsNtfy/index.tsx index 07f3e84dba..9e8bb2bedf 100644 --- a/src/components/Settings/Notifications/NotificationsNtfy/index.tsx +++ b/src/components/Settings/Notifications/NotificationsNtfy/index.tsx @@ -23,6 +23,8 @@ const messages = defineMessages( embedPoster: 'Embed Poster', url: 'Server root URL', topic: 'Topic', + tags: 'Tags', + tagsPlaceholder: 'eyes,warning', usernamePasswordAuth: 'Username + Password authentication', username: 'Username', password: 'Password', @@ -100,6 +102,7 @@ const NotificationsNtfy = () => { types: data?.types, url: data?.options.url, topic: data?.options.topic, + tags: data?.options.tags ?? '', authMethodUsernamePassword: data?.options.authMethodUsernamePassword, username: data?.options.username, password: data?.options.password, @@ -118,6 +121,7 @@ const NotificationsNtfy = () => { options: { url: values.url, topic: values.topic, + tags: values.tags, authMethodUsernamePassword: values.authMethodUsernamePassword, username: values.username, password: values.password, @@ -171,6 +175,7 @@ const NotificationsNtfy = () => { options: { url: values.url, topic: values.topic, + tags: values.tags, authMethodUsernamePassword: values.authMethodUsernamePassword, username: values.username, password: values.password, @@ -252,6 +257,21 @@ const NotificationsNtfy = () => { )} +
+ +
+
+ +
+
+