0

I'm looking for a way to modify an event (from my own module) when an user navigates to the account activation URL that they get in their mails. Are there any such hooks ready for me to use?

Also I would potentially need the $account-> mail variable if it's passed as an argument by any chance.

I've used this but it doesn't work as intended -

function my_module_form_alter(&$form, &$form_state, $form_id)
{
    // Trigger when at password reset form
    if ($form_id == 'user_pass_reset') {}
}

But the problem is I cannot seem to access the $account variable that way. What should I do?

0

Finally figured it out.

function my_module_lists_form_alter(&$form, &$form_state, $form_id)
{
    // Trigger when at password reset form
    if ($form_id == 'user_pass_reset')
    {
        // If $account has not been defined, define it from $user
        if (empty($account)) 
        {
            // Loads the user using the user id argument
            $account = user_load($form_state['build_info']['args'][0]);
        }

        // Log something
        watchdog('DEBUG MESSAGE:', 'We are there, user : ('.$account->mail.')!');
    }
}

If anybody has a better method, please do share.

0

Not sure if you are using the User Verification module. If yes, then you can try the hook they provide

hook_user_verify_verified

Hope this helps...

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.