Disable post notifications on one topic only


(Buford Taylor) #1

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.


(Jeff Atwood) #2

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?


(Buford Taylor) #3

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: discourse/notification-levels.js.es6 at c6ff387ce9d7660c804e9ba55096167dc427a751 · discourse/discourse · GitHub


(Jeff Atwood) #4

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


(Buford Taylor) #5

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


(Buford Taylor) #6

Went with Normal. All appears well. Thanks @codinghorror


(Jay Pfaffman) #7

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