• Resolved bitcloud

    (@bitcloud)


    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

    (@champsupertramp)

    Hi @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

    (@champsupertramp)

    Hi @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.