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?

  • Hey, did you manage to find a solution for this in the end?
    – James Kemp
    Nov 4 '14 at 12:21

Roles are assigned by the admin (or automatically by some theme or plugin) and therefor can not be assigned before the user is manageable by the admin, which doesn't happen before all the activation stages are completed. Therefor there is not enough info at the signup stage about the user role and you need to have to supply it in the form. You can have a role selection input or just use different forms for different roles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.