Restrict email recipients to group members
-
Hi Guys,
Great plugin!
However, I think the email recipients list should be restricted only to members of the groups the forum is associated to.
To do so, the get_recipients method of the bbPress_Notify_noSpam class (located into the bbpress-notify-nospam.php file), should be coded as follow:
. . . // Get the group ids corresponding to the forum id, in order to restrict email recipients only to members of these groups: $group_ids = bbp_get_forum_group_ids( $forum_id ); $users = get_users( array( 'role' => $role ) ); foreach ( ( array ) $users as $user ) { // Loop through these group ids: foreach ( $group_ids as $group_id ) { // Test if the user is member of the group: if ( groups_is_user_member( $user->ID, $group_id ) ) { $recipients[$user->ID] = $user; // make sure unique recipients } } } . . .
What do you think?
Cheers,
Eric Elzière.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Restrict email recipients to group members’ is closed to new replies.