• Resolved sezgee

    (@sezgee)


    Hi,

    I have a user role for new registrants that requires manual admin approval. This works fine. When the admin approves the user, they move them to the second user role.

    My second user role requires email activation. However, it looks like when an admin changes the user’s role, the email activation is not triggered. Is there a way to make this happen?

    I’ve enabled all email templates in the settings.

    Thanks,

    Sez

Viewing 2 replies - 1 through 2 (of 2 total)
  • @sezgee

    You can try this code snippet and change the ???????? to the new role ID.

    add_action( 'set_user_role', 'custom_role_is_changed_email', 10, 3 );
    
    function custom_role_is_changed_email( $user_id, $role, $old_roles ) {
    
        if ( $role == '????????' ) {
            um_fetch_user( $user_id );
            UM()->user()->email_pending(); 
        }
    }

    Add this code snippet to your active theme/child-theme’s functions.php file
    or use the “Code Snippets” plugin.

    https://ww.wp.xz.cn/plugins/code-snippets/

    Plugin Support andrewshu

    (@andrewshu)

    Hi @sezgee

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘1) manually approve 2) email activation’ is closed to new replies.