Override user registration function The default behavior for user registration is that if a user tries to register with an email that already exists, it lets them know and asks if they have forgotten their password. 

We have a custom link to our product download in the email the user receives, and what we'd like to do if a user tries to re-register with the same email is to just resend the email, without notifying them that they already have an account. 

I can't seem to find a way to do this. Any ideas? I'm not super-experienced with Drupal anymore.

CODE

function create_vector_user_form_user_register_form_alter(&amp;$form, &amp;$form_state) {
    error_log("form alter"); // this logs
    $form_state['values']['pass']['pass1'] = 'password';
    $form_state['values']['pass']['pass2'] = 'password';
    $form_state['values']['op'] = t('Create new account');
    $form['#submit'] []= "create_vector_user_user_register_submit";
}

function create_vector_user_user_register_submit($form, &amp;$form_state) {
    error_log("submit handler"); // this does not log
  $form_state['build_info']['args'] = array(&amp;$object);
  drupal_form_submit('create_vector_user_form', $form_state);
  drupal_set_message("The form is being submitted, do some extra stuff now...");
}
/**
 * Implements hook_form_BASE_FORM_ID_alter().
 */
function mymodule_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  array_unshift($form['#validate'],'my_first_custom_validation' );
  $form['#validate'][] = 'my_last_custom_validation';

}

function my_first_custom_validation(&amp;$form, &amp;$form_state){
  if(isset($form_state['values']['mail'])){
    if($user = user_load_by_mail($form_state['values']['mail'])){
      rules_invoke_component('rules_send_email_to_user', $user);
    }
  }
}



Hook into register form using hook form alter
Add custom validation handler to the top of submit handlers (must execute first before any other submit handler )
In the handler function  try to load user by email using user_load_by_mail
If true send the email using drupal_mail or rules then redirect to same page or any page to stop the execution.


The only problem with this code that the validation error still showing , I could not find way to stop drupal from execute the rest of validation handlers