BuddyDev

Search

[Resolved] Group Activities Notifier – Ignore 1 group

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 73
    Gregg Housh on #8599

    Hi, I’m so glad I got a subscription to your plugins. Love them.

    I am going to be using a bunch of them on a new site. One that I just installed is the Group Activities Notifier. It doesnt send email without some code changes, and I am totally fine with that. I just want the notifications. I have a different plugin for group activity emailing.

    But I need to keep 1 group from really spamming the users a LOT. I am using a group for support, and a bbpress forum in that group with a bbpress support ticket plugin. So all support is done in a group. I force everyone to join that group when they signup so they can get support.

    This would spam them a lot if I can’t block that group from sending notifications.

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #8603

    Hi Gregg,
    Thank you for the kind words and joining our premium membership.

    Here is the code that you can put in your bp-custom.php to skip the group

    
    
    /**
     * Skip a group from the group notifications.
     *
     * @param bool $skip true to skip notification.
     * @param BP_Activity_Activity $activity current activity instance.
     *
     * @return bool true to skip.
     */
    function buddydev_skip_group_from_notification( $skip, $activity ) {
    
    	$group_id = $activity->item_id;
    	//change the group id
    	if ( $group_id == 3 ) { //Please change '3' with your group id
    		$skip = true; //skip
    	}
    
    	return $skip;
    }
    add_filter( 'bp_local_group_notifier_skip_notification', 'buddydev_skip_group_from_notification', 10, 2 );
    
    

    Please change the group id with yours.

    Let me know if it works for you or not?

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 73
    Gregg Housh on #8605

    You are awesome. That works. I wasn’t expecting a fix so quickly.

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #8606

    Thank you for the appreciation Gregg.

    I am glad I was able to help 🙂

The topic ‘ [Resolved] Group Activities Notifier – Ignore 1 group’ is closed to new replies.

This topic is: resolved