apprise icon indicating copy to clipboard operation
apprise copied to clipboard

Nextcloud group support

Open oleua opened this issue 1 year ago • 3 comments

Hi! Is that possible to make Nextcloud notifications be extended to groups of users? So, I can send notifications to groups. Plus, to add the possibility to send the notification to all active users (eg everyone)?

oleua avatar Apr 17 '24 19:04 oleua

Taking into account that NC cannot list users of a specific group, I suggest this workaround to send text message to a specific group:

php ./occ group:list | \
sed -En '/^[[:space:]]*-[[:space:]]<groupname>.$/,/^[[:space:]]{2}-[[:space:]][^-]/{/^[[:space:]]*-[[:space:]]/{s/^[[:space:]]{4}-[[:space:]]//p}; /^[[:space:]]*-[[:space:]]/d}' | \
xargs -i php ./occ notification:generate -l "Body of the message" {} "Header of the message"

Perhaps you may update existing Nextcloud notifications provider or create a new eg Nextcloud group notifications provider?

And this one for sending to ALL users:

php ./occ user:list | sed 's/.*- \(.*\):.*/\1/' | \
xargs -l -i php ./occ notification:generate -l "Body of the message" {} "Header of the message"

Inspired by https://github.com/nextcloud/notifications/issues/121 and long-time training ChatGPT :)

oleua avatar Apr 17 '24 23:04 oleua