Validate a users email address when using gmail to register

Hmm, should try harder before asking for help 🙂 Was quite simple in the end (right or wrong) it works: $domain_array = array(‘googlemail.com’,’gmail.com’); $validemail = is_email($email_to_check); $exists_text=””; if ($validemail): $exists = email_exists($email_to_check); list($user, $domain) = explode(‘@’, $email_to_check); if (!$exists): if (strpos($user, ‘+’)) { list($username_email, $crap) = explode(‘+’, $user); $exists = email_exists($username_email . ‘@’ . $domain); … Read more

WordPress is executing URL in code when called via wp_mail()

Please try the following, I think having a return from the site_url() function could be creating a problem with the $confirm_url variable. That and you have an unescaped slash in your url. $site_url = site_url(); $confirm_url = $site_url. ‘\/verification?id=’ . $post_id . ‘&hash=” . $hash; // Send a verification e-mail to the user to confirm … Read more

wp_insert_user – how to send verification email before logging in

1. Insert user data into wp_users table. Create a page called “Activation” or similar to it and get the ID of that page. An activation email will be sent with the activation link to the user. function new_user($data) { // Separate Data $default_newuser = array( ‘user_pass’ => wp_hash_password( $data[‘user_pass’]), ‘user_login’ => $data[‘user_login’], ‘user_email’ => $data[‘user_email’], … Read more

How to set up User email verification after Signup?

You can use user_register hook add_action( ‘user_register’, ‘my_registration’, 10, 2 ); function my_registration( $user_id ) { // get user data $user_info = get_userdata($user_id); // create md5 code to verify later $code = md5(time()); // make it into a code to send it to user via email $string = array(‘id’=>$user_id, ‘code’=>$code); // create the activation code … Read more

Give to site admin the option to “skip confirmation email” when adding new user

Paste this in your functions.php file: function my_skip_confirmation_email() { if ( is_multisite() && current_user_can( ‘create_users’ ) ) { ?> <table class=”form-table”> <tr> <th scope=”row”><?php _e( ‘Skip Confirmation Email’ ); ?></th> <td> <input type=”checkbox” name=”noconfirmation” id=”noconfirmation” value=”1″ /> <label for=”noconfirmation”><?php _e( ‘Add the user without sending an email that requires their confirmation.’ ); ?></label> </td> </tr> … Read more

How can I be certain that a user has verified their email after registration?

I’ve tried a few different approaches for verifying the user’s email. For now, what I am doing is this: When a user first registers, set the user’s user_metadata ’email_not_verified’ to 1. add_action( ‘user_register’, ‘sc_user_email_not_verified’ ); function sc_user_email_not_verified( $user_id ) { update_user_meta( $user_id, ’email_not_verified’, 1 ); } Then, override the wp_new_user_notification function so that it adds … Read more

Mass registrations on my blog. Disable specific domain?

BTW you can try this one. I just put together something. It should block gmail.com domain. This function will check for email domain when someone tries to register on your website and throws an error if email domain is matched. function wpse_disable_email_domain( $errors, $sanitized_user_login, $user_email ) { list( $email_user, $email_domain ) = explode( ‘@’, $user_email … Read more