• Resolved fanee

    (@fanee)


    Hi,
    I have a custom requirement where new users should be approved by admin after registration.
    But if users have email from specific domains (a whitelist) like *@abc.com,*@dd.com then they should be registered automatically and assigned a wp role as well.

    My first question is , using this plugin, do the people still get a email first to verify email.

    2nd Question: Is there a hook like after_email_verified which I can use so that when email is verified I can register users whitout admin approval.
    Is it possible to do this ?
    A functional hook code sample will be much appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi fanee,

    Yes, the user will get all the expected emails and account activation prompts. They’ll basically have a full working WordPress user. However, our plugin here adds a user meta row that indicates that they’re not approved. Depending on the chosen settings, like if it’s a private network or not, they’ll either have the links/ui to interact hidden, to the best of our ability at current time, or they’ll be redirected to their user profile. When in private network, their own user profile will be the only BuddyPress/bbPress area they can visit, zero interaction or ability to even see those areas. They would however be able to visit the primary blog/blog posts, any pages you may have added outside of the social plugins, or say a woocommerce shop.

    Regarding the second question, best I have at the moment is using the user_register hook like we do, but at a lower priority. We use the default 10, so doing something like 11 would suffice. You’d be passed the user ID, and you could do some email address verification. If they meet your needs there, then you could use our moderation status function to mark them as no longer pending. Example: bp_registration_set_moderation_status( $user_id, 'false' ); The false basically says “nope, no longer pending”, while leaving the user in tact.

    Hope that helps.

    Thread Starter fanee

    (@fanee)

    will bp_registration_set_moderation_status( $user_id, 'false' ); also trigger email to user that your account has been verified ?

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    No, that part would not be covered in retrospect. I don’t have a single-purpose function for that part, so it’d be a copy/paste case for what I have in the plugin as is.

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

The topic ‘email_verified hook ?’ is closed to new replies.