Yes. You can take advantage of the meta filter capability to divide your users into groups. There are examples of using filters on the plugin’s Description page here on WordPress.org. Scroll down to the Custom Filter Usage section.
Thanks for the reply. I am new to this of of coding.
If I want to send to people whose display name starts with a-z, would I write
add_action( ‘mailusers_user_custom_meta_filter’, ‘username_starting_with_a or b or c or d or e’, 5 );
function username_starting_with_a-e()
{
mailusers_register_user_custom_meta_filter(‘username: A-E’, ‘last_name’, ‘M%’, ‘LIKE’);
}
Probably wrong and outside the scope of the assistance you offer.
thanks for any assistance you can provide
gary
I had to think about this one a bit, sorry for the delayed response. The examples I have using the “LIKE” SQL construct won’ work because the patch I submitted to WordPress 4+ years ago was never incorporated into WordPress Core. I have no idea why, it was supposed to happen in 3.6.
It turns out WordPress added support for the REGEXP construct in user queries in 3.7 and it is actually a better solution than using the SQL LIKE construct.
To solve your problem you would do something like this to create a limited user distribution list based on last names:
add_action( ‘mailusers_user_custom_meta_filter’, ‘last_names_starting_with_s_through_z’, 5 );
function last_names_starting_with_s_through_z()
{
mailusers_register_user_custom_meta_filter(‘Last Name: S-Z’, ‘last_name’, ‘^[S-Z]’, ‘REGEXP’);
}
You would add this code to your theme’s functions.php file or you can create a simple plugin. I have updated the plugin’s ReadMe file with the updated examples so the plugin description page is now updated as well.
I’ve wrote a post containing some example images of using the updated custom meta filters on my web site.