How to Automatically Mute Categories When a User Leaves a Group?

Hi Discourse Team & Community,

I’m looking for a way to automatically mute a category when a user leaves a group.

:rocket: What I Want to Achieve

  • When a user joins a group, they track the group’s related category (this works via Group Category Notification Default). [:white_check_mark: I already did it with Custom Wizard plugin]
  • When a user leaves a group, their related category should be muted automatically, so they stop receiving notifications and email digests.
  • Ideally, this should be fully automated without manual intervention.

:red_question_mark: My Questions

:one: Is there a built-in way (without coding or API calls) to mute a category when a user leaves a group?
:two: Would it be possible to add “User Leaves Group” as a trigger in the Discourse Automations Plugin?
:three: Any workarounds that don’t require manual admin intervention?

I’d love to hear how others have handled this scenario or if there’s any feature request in progress to add this capability.

Thanks in advance! :raising_hands:

If a category is allowed to that group there is no need to mute anything, because there is no access after leaving that group.

2 Likes

Thanks @Jagster.
Yes, I noticed it that there is no access after leaving the group.
But still the category appearing in user side. And latest posts also appearing in latest tab.

I just want to mute the related category to not show it there.
I am looking for a automated process for this scenario.

That shouldn’t be happening. Is the category a secure category which only the group has access to?

2 Likes

No, category has access to be seen by everyone.
I wanted to do this on Public groups.

1 Like

I think you might need maybe a Custom Automation maybe.

Though this type of idea would be a nice addition to group settings maybe as a toggle when one leaves group. To undo/mute certain things originally changed)granted when added to a group

4 Likes

Not sure but you might also either be able to use custom wizard if it can be auto triggered or maybe paired with an automation. I would check with Pavilion.

1 Like

I don’t understand the logic behind this.

  • a random visitor sees category X and sees it , even in /latest
  • a user logs in, isn’t member of group X, sees cat X and it is on /latest
  • a user joins to group X and gets all rights (that is point of the group?)
  • a user leaves group X, can still see cat X, but it doesn’t show up in /latest

Why :thinking:

2 Likes

Do you want to actually mute it, or just set the notifications back to “normal” ?

If it’s the latter, I would say this is actually a Bug (or better: the implementation does not fit this use case, while it feels logical that it would).

When I set group X to watch category Y, and become a member of that group, I’m indeed automatically watching category Y. Category Y is copied to my “watching” categories. There is no trace of how it got there, we don’t know if it was there because I added it before or if it was there because of my group membership.

When I leave group X, I keep watching category Y. The category is not removed from my “watching” categories, as one would expect.

Changing this implementation would be quite an effort, so I guess this would be something for a plugin right now. Just have something trigger on group removal
with the :user_removed_from_group event, get the categories, remove them from the user preferences.

3 Likes

Do you see any chance that this could be implemented without core support?

Is there already a machinery implemented which could be used to track user interventions on notification levels?

2 Likes

Not as far as I am aware.

2 Likes

Thanks @Jagster
actually I would like to implement it for large forum, I just want to keep the place clean and everyone should see topics according their group selection.

Okay, I will try to check it with Pavilion.

1 Like

I wanted to mute it but normal also okay for this case.

1 Like

I agree with this approach - one that this less rigid than the traditional binary access / no access.

It is often useful to have things freely accessible to those that dig for it, but only highly visible / notifying to a select group of people. This is pretty easy to initiate in Discourse, but hard to retract - I believe that this is what you are looking to do.

Users can of course do this themselves, but are generally pretty useless on that front.

Unfortunately, the Custom Wizard Plugin 🧙 requires user interaction to initiate stuff like that. An automation (likely bespoke) would be needed to remove the watching status of those that are no longer in a group.

Or this needs to be a feature request to alter the core behaviour. There are a few feature requests along these lines already.

1 Like