Disable post notifications on one topic only

Hi all,

Our community has a surge of invite-only users all at once (roughly 400 of them) every few months. We make a new topic called “Introduce yourself to the Community” where all 400 people can say a few words.

In order to combat spam, we turn off all emails while this particular thread is live, but it’s not ideal because legitimate topics are posted and do not surface in the users’ inboxes.

Is there a way to disable all notifications for this one topic? (or disable all notifications for posts on this one topic)

I’ve installed discourse on digital ocean and am happy to do anything within the console. I had a look through the code but didn’t find anything relevant.

1 Like

Users can mute the topic, that’s all I can think of at the moment.

You could run a Ruby/Rails command at the Rails command line to mute the topic for all existing users by updating their user preferences, but new users who sign up after you run that command will not have the topic muted.

Do note that only people with that topic in a “watched” state will get emailed for new replies, and even then, only if their web browser has not pinged the website in the last 10 minutes. So you could target this a little more surgically to update all user preferences from “watched” or “tracked” to “normal” on this particular topic. Perhaps @techapj could advise on the exact Rails command?

Got it. I think we’re happy with new users receiving notifications for this topic (since there will be no new users for another few months).

Looking at the code, it seems Topic.find(id).topic_users.update_all(notification_level: 0) will do the trick. Can anyone confirm?

0 appears to be the muted state according to this code: https://github.com/discourse/discourse/blob/c6ff387ce9d7660c804e9ba55096167dc427a751/app/assets/javascripts/discourse/lib/notification-levels.js.es6

5 Likes

I wouldn’t mute the topic for everyone, I’d set it to normal.

Gotcha. So you recommend setting it to 1, REGULAR?

https://github.com/discourse/discourse/blob/c6ff387ce9d7660c804e9ba55096167dc427a751/app/assets/javascripts/discourse/lib/notification-levels.js.es6

2 Likes

Went with Normal. All appears well. Thanks @codinghorror

6 Likes

My suggestion would be to create a category for those messages and people could adjust the category watching.

1 Like