# Procedurally nullify notifications for a group

**URL:** https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976
**Category:** Support
**Tags:** notifications
**Created:** [January 17, 2024, 5:37pm UTC](https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976 "2024-01-17T17:37:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Frully](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frully/32/235059_2.png) [@Frully](https://meta.discourse.org/u/Frully)
#### Post date: [January 17, 2024, 5:37pm UTC](https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976/1 "2024-01-17T17:37:19Z")

</div>

TLDR: Feb 2024 Google is changing their acceptable spam ratio to 0.3%. I want to reduce outbound email volume to avoid getting flagged. (3 spam flags/1000 emails will get your domain blacklisted). I need to procedurally change ‘watching first post’ for certain groups.

My nonprofit is a physical organization that uses discourse to facilitate member/community engagement. In particular, we opt new members into mandatory notifications regarding our organization (meeting agendas, votes, and critical updates. We’re legally allowed and obligated to send these emails).

- Currently: Our member portal adds new discourse users via API, and assigns them to ‘current\_members’ group so long as they are in good standing.
- Current members’ group is set to Categories: Watching First Post: Official Announcements.

So far so good.

- When they quit/expire, we (api) move them to ‘former\_members’ for a variety of permissions. When members expire/quit/etc, we keep their account active as a ‘public non member’ permission level so they can still engage with the community.
- Goal: Remove the watch-first-post elective on group-add.

> **Screenshots**
>
> ![Former Member Group Settings](https://global.discourse-cdn.com/meta/original/4X/5/3/3/53344e4f93ffa0adcfdbd7eea6e53e90dfa4c723.png)  
> Group settings assign no watch.
> 
> ![Example Former Member](https://global.discourse-cdn.com/meta/original/4X/b/c/d/bcd2a88f2e055fff715339a5b172cdc4a590850c.png)  
> Group member still has watch.

- Moving to a group seems only to be additive. Is there a way to designate ‘remove’ tracking based on group add?
- Is there a way to remove track settings that were added by group membership? (ie on group leave, undo whatever was added).

Alternatively, we could use @ tagging, but it would super easy to accidentally abuse. Having the groups manage the notification level would be easiest.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 18, 2024, 4:51pm UTC](https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976/2 "2024-01-18T16:51:08Z")

</div>

> [@Frully](#):
>
> Is there a way to remove track settings that were added by group membership? (ie on group leave, undo whatever was added).

I think that’s what to do. Remove those watched categories when they leave. You can [Reverse engineer the Discourse API](https://meta.discourse.org/t/reverse-engineer-the-discourse-api/20576) to find the API call to change their watched categories.

---

<div class="post-metadata">

### Author: ![Frully](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frully/32/235059_2.png) [@Frully](https://meta.discourse.org/u/Frully)
#### Post date: [January 18, 2024, 5:05pm UTC](https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976/3 "2024-01-18T17:05:44Z")

</div>

The trouble is I have hundreds of users in this boat. Setting it up for future is bonus but having an explicit null empty list would be a great feature.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 18, 2024, 5:40pm UTC](https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976/4 "2024-01-18T17:40:08Z")

</div>

Then a rails command that removed watches for the users from the expired group might be a solution. I can’t remember if changing the setting for the group will offer to apply it to all members. You might give that a go (make the expired group watch the category and then remove that watch?)

---

<div class="post-metadata">

### Author: ![Frully](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frully/32/235059_2.png) [@Frully](https://meta.discourse.org/u/Frully)
#### Post date: [January 18, 2024, 9:39pm UTC](https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976/5 "2024-01-18T21:39:30Z")

</div>

I’ll give that a shot. I know the addition of a watch will offer recursive. I couldn’t find a way to remove a watch that wasn’t there. You’re right it might be a matter of adding and removing.

---

<div class="post-metadata">

### Author: ![Frully](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frully/32/235059_2.png) [@Frully](https://meta.discourse.org/u/Frully)
#### Post date: [January 19, 2024, 2:09pm UTC](https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976/6 "2024-01-19T14:09:05Z")

</div>

> [@pfaffman](#):
>
> make the expired group watch the category and then remove that watch

This is the magic. Adding to a group that lacks the flag doesn’t assert removal of the flag - that would be a nightmare to maintain…but retroactively applying the flag and then removing the flag to the group works as a decent workaround if I only have to do it annually-ish.

#feature-request - ability to assert a ‘nullify’ category or tag on group add would be sweet.

 ![cat tax](https://global.discourse-cdn.com/meta/original/4X/4/8/5/4851d58c4f7f5501ca061f8b54d5dd2708cb3e5c.jpeg)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 18, 2024, 2:09pm UTC](https://meta.discourse.org/t/procedurally-nullify-notifications-for-a-group/291976/7 "2024-02-18T14:09:22Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
