How to bulk update user's category notification level?

I used to mute a category for all users by default but then find none of them looks at the category list and unmute the category. After I remove the default setting, new users start contribute to the category, the old user(around half) still didn’t where to unmute the category, I tried to use pinned topic to explain how to do it, doesn’t work well.

So is that possible to update the notification level for them?

2 Likes

You’ll want to look at the default categories ... group of settings in your Admin dashboard, if you have removed the categories from the default categories muted site settings, maybe you could use any of the other default categories ... site settings to apply the changes retroactively.

There are the default categories watching, default categories tracking and the default categories regular site settings to use here, they work in retrospect.

2 Likes

I tried to use this setting to unmute the category but it says only 8 users will be updated, but as I check through data explorer, there are roughly 1100 users who have this category muted (due to my previous settings)

Also, the category used to be muted by default for a group, does it make a difference between the default group category vs the global setting?

1 Like

One solution if there is a common news category. Create a post explaining how to subscribe to a category and provide links to each Category with a description.

I have tried this as well but it doesn’t work as expected…would it be possible to bulk update in the console?

1 Like

That I am not sure. Imagine it might be possible maybe in the commandline. However not sure on a how to if possible.

I think there should be a feature to do bulk changes for all users or just users in a group.

As I understand it, the group setting just gets applied when a user joins the group. So one approach to adjust this is to create a group with the settings you want to change and add the people you want changed to that group.

You can also do this with the API.

Do you have an example of how to do it through API?

I actually do, yes.


    category_notifications = {'muted_category_ids': [54],
                              'regular_category_ids': [],
                              'tracked_category_ids': [],
                              'watched_category_ids': [],
                              'watched_first_post_category_ids': [61],
                             }
	
    api(config, f"u/{username}.json", method='put',
          json=category_notifications)

… where api() is a thin wrapper around the Requests python module and just does an HTTP PUT to /u/whateverusernameyouarechanging.json on your Discourse site, and the payload is just the categories you want changed. (You can skip any ones you don’t want to change.)

Note that you need the numeric category IDs — names won’t work. And of course if you want to merge or preserve what’s there already you’ll have to read the user first.

4 Likes