1

Is there a way to store/save the user verification email link in the database after a new user creates an account?

2

Yes, hook_mail_alter() enables you to alter any email messages sent out from hook_mail() if you know the specific key associated with the email. In this case, the key is user_register_no_approval_required. From that point, all you have to do is parse the email message body for the relevant URL and save it to your desired location.

function MYMODULE_mail_alter(&$message) {
  if($message['id'] == 'user_register_no_approval_required') {
    //@TODO: Parse $message['body'] for email verification link and save it
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.