Fallenbagel / jellyseerr

Fork of overseerr for jellyfin support.
https://docs.jellyseerr.dev/
MIT License
3.95k stars 249 forks source link

[Feature Request] Support Gotify #92

Closed schklom closed 2 years ago

schklom commented 2 years ago

Description

Notification settings include most systems, except the self-hosted ones. Please add support for Gotify (https://gotify.net/docs/more-pushmsg for examples with code).

Desired Behavior

A Gotify section at the URL /settings/notifications/webhook

Additional Context

Gotify supports Markdown, so it is capable of displaying images.

Currently, I have to use the webhook in order to use Gotify ~,but the webhook does not allow to use Markdown.~

If it helps, this is my current JSON payload:

{
    "title": "{{subject}}",
    "message": "notification_type: {{notification_type}}\n\nmessage: {{message}}\n\nimage: ![]({{image}})\n\n\nemail: {{notifyuser_email}}\n\nusername: {{notifyuser_username}}\n\navatar: {{notifyuser_avatar}}{{media}}:\n\n- media_type: {{media_type}}\n\n- tmdbId: {{media_tmdbid}}\n\n- imdbId: {{media_imdbid}}\n\n- tvdbId: {{media_tvdbid}}\n\n- status: {{media_status}}\n\n- status4k: {{media_status4k}}\n\n\n\n{{request}}:\n\n- request_id: {{request_id}}\n\n- requestedBy_email: {{requestedBy_email}}\n\n- requestedBy_username: {{requestedBy_username}}\n\n- requestedBy_avatar: ![]({{requestedBy_avatar}})",
    "priority": 1,
    "extras": {
        "client::display": {
            "contentType": "text/markdown"
        }
    }
}

It is hacky, not user-friendly at all, ugly, but it works. The webhook URL is http://gotify/message?token=XXXXXXX.

Edit: better JSON webhook

Fallenbagel commented 2 years ago

For now we are focusing on getting all features available on overseerr to jellyseerr.

Also is it not possible to use webhook option for gotify? I use ntfy which is also selfhosted and works the same as gotify but I like it much better.

https://ntfy.sh

schklom commented 2 years ago

@Fallenbagel Thanks for the fast reply. It is possible, I showed an example, but it is ugly.

Also, ntfy is cool but I don't like it personally. I feel it is more suited for a corporate environment, because it is not user centered but room centered. :P

At least, it would be nice to provide an example of a pre-made JSON for Gotify. One for ntfy would be cool too :)

Fallenbagel commented 2 years ago

At least, it would be nice to provide an example of a pre-made JSON for Gotify. One for ntfy would be cool too :)

I could provide for Ntfy but not gotify since I don't use gotify unfortunately 😔

Fallenbagel commented 2 years ago

@schklom wait. are you on the latest tag or develop? Because Gotify is already available image

Fallenbagel commented 2 years ago

And as promised for ntfy, here's a json payload you can use. Remember to change the https://requests.example.com to your url. And the topic too according to which topic and priority to whichever you want. With this config you can press the notification and it will direct you to the media page (as you can see with the click json key).

{
    "topic": "requests",
    "title": "{{event}}",
    "message": "{{subject}}\n{{message}}\n\nRequested by: {{requestedBy_username}}\n\nStatus: {{media_status}}\nRequest Id: {{request_id}}",
    "priority": 4,
    "attach": "{{image}}",
    "click": "https://requests.example.com/{{media_type}}/{{media_tmdbid}}"
}

Screenshot_20220520-041018_ntfy

with this I'm closing this issue as Gotify is already available and ntfy pre-config is provided here.

schklom commented 2 years ago

Ok, I will switch to the develop tag. I should have tried it before making an issue x) Thanks for the quick replies :)