Thanks for that guidance, mmm. That was helpful. I resolved the problem this way:
// Adds "Send rejection email" action to Users page
function jm_send_rejection_link($actions, $user_object) {
if( ($_GET['action'] == 'jm_send_rejection') && ($_GET['user'] == $user_object->user_email) ) {
$sendto = $_GET['user'];
$sendsub = "Your registration has been rejected.";
$sendmess = "Your registration for has been rejected.";
$headers = array('From: The Company <[email protected]>');
wp_mail($sendto, $sendsub, $sendmess, $headers);
echo '<div class="updated notice"><p>Success! The rejection email has been sent to ' . $_GET['user'] . '.</p></div>';
}
$actions['send_rejection'] = "<a class="jm_send_rejection" href="" . admin_url( "users.php?action=jm_send_rejection&user=" . $user_object->user_email ) . "">" . __( 'Send Rejection' ) . "</a>";
return $actions;
}
add_filter('user_row_actions', 'jm_send_rejection_link', 10, 2);
This definitely corrected the issue I was having with the first user in the list. It did not resolve the issue with the one other account not receiving emails, but I am 90% sure this has something to do with that account’s email server settings, rather than with my code.