Filters and BCC limits
-
Hi
Thanks for working on what many WordPress blogs need.
I tried to use it in my application (a community action group) and could not for two reasons, which I thought might be worth explaining.
1. We send out two types of posts, some to everyone that is marked to receive mail, and some only to financial members (things like committee minutes and financial information). In both cases I would need to filter the recipients. Thus a filter as the emails are being added to the recipients list would be ideal (as per code below).
2. Secondly I suspect you will have severe problems with just adding all recipients to the BCC list. I think most mail servers have a limit in the hundreds here – Surely you haven’t managed 300,000 as suggested in the FAQ??
/*
Logic to retrieve to whom the notif should be sent
*/
function bnfw_get_recipients_for_type($notification_type){
$bnfw_options = get_option(‘bnfw_settings’);
$recipients = ”;
if ( !isset( $wp_roles ) )
$wp_roles = new WP_Roles();
foreach ($wp_roles->roles as $field => $role) {
if($bnfw_options[$notification_type.’-‘.$field] === “1”){
$users = get_users(‘role=’.$field);
foreach ($users as $the_email) {
if (apply_filters(“bnfw_filter_user “, true)) {
$recipients .= $the_email->user_email . ‘,’;
}
}
}
}
return $recipients;
}
- The topic ‘Filters and BCC limits’ is closed to new replies.