caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
11.7k stars 410 forks source link

Add Actions and Links to Nextcloud Notification #1048

Open dretechtips opened 8 months ago

dretechtips commented 8 months ago

:bulb: The Idea

This issue extends upon the existing closed issue #159 . Nextcloud Notification has the option to add links which allows a user to go invoke a URL after clicking on the notification. Nextcloud Notification also has the option to add actions button which gives the user the option to invoke a specific URL based on the action that the user wants to perform. Nextcloud notification does not render links within the body message. See this issue about Nextcloud client link rendering problem.

:hammer: Breaking Feature

What I propose is that the Apprise adds additional parameter to the notify_nextcloud specification that supports adding links and actions to the Nextcloud notifications.

As an example we can add the link parameter can be formatted such as the following.

https://admin:password@nextcloud.domain.tld/user_a?link={uri_encoded(link_to_action)}

The URL would allow the user who receives the notification to click on the notification and perform a defined action.

Another example, would be prompting the user multiple actions using the following formatted link parameters such that the key is the button displayed value and the value is the button URL and button method.

https://admin:password@nextcloud.domain.tld/user_a?uri_encoded(action_url[key_1]=value_1&action_url[key_2]=value_2&...&action_url[key_n]=value_n)&
uri_encoded(action_method[key_1]=value_1&action_method[key_2]=value_2&...&action_method[key_n]=value_n)

The URL would allow the user who receives the notification to perform actions within the set of definition actions.

As it stands right now, the Apprise API to the Nextcloud notification only informs the Nextcloud end users. However, these changes should allow the Nextcloud end user to conveniently perform actions defined by the administrators using the Apprise API.

caronc commented 8 months ago

Hi, is there a reason you closed this ticket off?

dretechtips commented 8 months ago

Hi, is there a reason you closed this ticket off?

The admin notification API does not support links and actions. Only the app notification API supports links and actions. The feature seems feasible to implement, however a Nextcloud Apprise app would have to be created. The apprise notification would interface through the app instead of the default admin notification.

https://github.com/nextcloud/notifications/blob/master/docs/notification-workflow.md

caronc commented 8 months ago

Yeah, having time to review this now, i'm not sure if it would be that straight forward to adapt Apprise to this unless you had an idea?