Account activation via email confirmation and admin review COMBINED
-
Dear UM team,
In UM, I can set the activation process of a new account to auto approval, confirmation via email OR admin review. What I need is a combination of the latter two: User has to confirm the email address via confirmation/activation link sent by email, and then I want to also have an admin check the new user account before it gets approved.
I have analyzed the UM code a bit and found a quite simple solution to achieve this, which I’d like to share with you for feedback and with other users who have the same problem/need:
1. In the role for new users, set the registry options to ’email confirmation’.
2. In the same group of registration options, add a forward to a web page where you explain to the user that email is confirmed and his account will be activated after admin approval.
3. In the function ‘activate_account_via_email_link’ (in includes/core/class-permalinks.php), add these 3 lines right before the line ‘UM()->user()->approve()’:
UM()->user()->set_status( ‘awaiting_admin_review’ );
UM()->mail()->send( $email, ‘notification_review’, array( ‘admin’ => true ) );
return;What step 3 does: It changes the account status from email conf. to admin approval, sends the review notification email to the admin and then skips the rest of the function.
My question to the UM team: Is this a safe “hack”? Is it possible to do this in the child theme so it’s update-proof? Do you happen to have another idea/solution to enable both email confirmation + admin approval?
Kind regards, Roger
- The topic ‘Account activation via email confirmation and admin review COMBINED’ is closed to new replies.