• Resolved wallacelin

    (@wallacelin)


    Hello, I’m using bbPress and Boss theme to build a website with two forums: Community and Support. I’d like to send an email notification to admins/mods only when a new topic is created in Support. Is it possible to specify one forum in multiples for notifications?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author useStrict

    (@usestrict)

    Hi @wallacelin,

    You can achieve that by hooking into bbpress_topic_notify_recipients, effectively removing all recipients if the forum_id doesn’t match the one you want.

    This is the filter call:

    apply_filters( 'bbpress_topic_notify_recipients', $recipients, $topic_id, $forum_id );

    Cheers,
    Vinny

    Thread Starter wallacelin

    (@wallacelin)

    Thanks for the answer Vinny! My support forum ID is 996, so I’ll add apply_filters( 'bbpress_topic_notify_recipients', $recipients, $topic_id, 996 ); to my theme’s functions.php.

    Plugin Author useStrict

    (@usestrict)

    Nope. That’s what the plugin calls. You’ll have to add the following to your functions.php to hook into it:

    add_filter('bbpress_topic_notify_recipients', 'my_whitelist_forum_notification', 10000, 3);
    function my_whitelist_forum_notification($recipients, $topic_id, $forum_id)
    {
    	if ( 996 !== (int) $forum_id )
    	{
    		$recipients = array();
    	}
    	
    	return $recipients;
    }
    

    Cheers,
    Vinny

    Thread Starter wallacelin

    (@wallacelin)

    Ahh righto don’t know what I was thinking (or rather not thinking). Thank you once again!

    Plugin Author useStrict

    (@usestrict)

    My pleasure!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Notify for a Specified Forum?’ is closed to new replies.