I'm looking for a way to customize the welcome email, ONLY for new users with a certain role. (I use the Gravity Form User Registration Add-On to allow visitors to vote, thereby registering as "Voter".)
I've managed to customize the email for all new users:
function customize_activation_email_voter($message) {
return 'To confirm your vote, click on the following link: %s';
}
add_filter('wpmu_signup_user_notification_email', 'customize_activation_email_voter', 20, 2);
But not for only "Voters".
One problem is that there is no regular user metadata stored in the WP database yet, because technically, the user is not yet a user - that happens only after activation (in my case, confirmation of the vote).
Is there a way to get the user's role before the activation of their account?