Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
I’m pretty sure (99.44%) that they will not get an email notification and will only see the difference when they login.
You can make it 100% 🙂
A simple way to email your users when changin their role is by adding this code to your active theme’s functions.php file or in an empty plugin like this one.
function email_user_role_update( $user_id, $new_role ) {
$site_url = get_bloginfo('wpurl');
$user_info = get_userdata( $user_id );
$to = $user_info->user_email;
$subject = "Role changed: ".$site_url."";
$message = "Hello " .$user_info->display_name . " your role has changed on ".$site_url.", congratulations you are now an " . $new_role;
if ( strtotime ( $user_info->user_registered) < strtotime ('-30 minutes') ) {
wp_mail($to, $subject, $message);
}
}
add_action( 'set_user_role', 'email_user_role_update', 10, 2);
Hope this helps!