Skip to:
Content

Opened 2 years ago

Last modified 23 months ago

#3046 new enhancement

bbPress 2.5.12 is sending out emails to subscribed blocked users

Reported by: casiepa Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.5
Component: API - Subscriptions Keywords: needs-patch needs-unit-tests
Cc:

Description

When users get the 'blocked' role, they do not get unsubscribed from forums (ok, could be fine because you don't want to resubscribe if they get reinstated), but they are still getting emails on new topics and that does not seem very logical.

I have added the following filter for now in my bbP Toolkit to avoid this issue, but I think it should be added to the basic functionalities.

<?php
// Blocked users should NOT get an email to subscribed topics
function bbptoolkit_fltr_get_forum_subscribers( $user_ids ) {
        if (!empty( $user_ids ) ) {
                $new_user_ids = array();
                foreach ($user_ids as $uid) {
                        if (bbp_get_user_role($uid) != 'bbp_blocked') {
                                $new_user_ids[] = $uid;
                        }
                }
                return $new_user_ids;
        } else {
                return $user_ids;
        } 
}; 
// add the filter 
add_filter( 'bbp_forum_subscription_user_ids', 'bbptoolkit_fltr_get_forum_subscribers', 10, 1 ); 

Change History (2)

#1 @netweb
2 years ago

  • Component changed from General to API - Subscriptions
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 2.7
  • Type changed from defect to enhancement
  • Version changed from 2.5.11 to 2.5

Lets look at this for both forums and topics once 2.6 is out the door

#2 @netweb
23 months ago

  • Keywords needs-unit-tests added
Note: See TracTickets for help on using tickets.