Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextcloud group support #1111

Open
ostasevych opened this issue Apr 17, 2024 · 1 comment
Open

Nextcloud group support #1111

ostasevych opened this issue Apr 17, 2024 · 1 comment

Comments

@ostasevych
Copy link

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)?

@ostasevych
Copy link
Author

ostasevych commented Apr 17, 2024

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 nextcloud/notifications#121 and long-time training ChatGPT :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant