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.