Is there a way to store/save the user verification email link in the database after a new user creates an account?
1 Answer
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
}
}