Title: &#8220;Email in use&#8221; error hook?
Last modified: May 18, 2020

---

# “Email in use” error hook?

 *  Resolved [bitcloud](https://wordpress.org/support/users/bitcloud/)
 * (@bitcloud)
 * [6 years ago](https://wordpress.org/support/topic/email-in-use-error-hook/)
 * Hi, I’m trying to hook into the “This email is already linked to an existing 
   account” error to add that existing email to the current multisite blog.
 * Currently I have:
 *     ```
       add_filter( 'um_submit_form_error', 'my_submit_form_error', 10, 2 );
       function my_submit_form_error( $error, $key ) {
           if ($error == "This email is already linked to an existing account") {
                //Here I would like to take the existing email address and add it to the list of users for this site.
           }
       return $error;
       }
       ```
   
 * Does anyone have any idea how I could expose the submitted email address within
   this function, or does anyone have a better idea? Thanks

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

 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/email-in-use-error-hook/#post-12858622)
 * Hi [@bitcloud](https://wordpress.org/support/users/bitcloud/)
 * You could try the following code snippet:
 *     ```
       add_filter( 'um_submit_form_error', 'my_submit_form_error', 10, 2 );
       function my_submit_form_error( $error, $key ) {
            $email_value = UM()->form()->post_form[ $key ]; 
           if ( "user_email" == $key && $user_id = email_exists(  $email_value )  ) {
                 // do something with the $user_id of the existing email.
           }
           return $error;
       }
       ```
   
 * Regards,
 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/email-in-use-error-hook/#post-12870484)
 * Hi [@bitcloud](https://wordpress.org/support/users/bitcloud/)
    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 ‘“Email in use” error hook?’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * Last activity: [5 years, 12 months ago](https://wordpress.org/support/topic/email-in-use-error-hook/#post-12870484)
 * Status: resolved