0

I am running Magento 1.7 Community Edition. When I manually (admin panel) create a new user account for one of my clients and select randomly generate password it creates the user but never send the email with the password.

However if I revisit the user after its been created and recheck randomly generate password and click save it will send the email.

Any ideas why it won’t work when I create the user?

Thanks

1 Answer 1

1

I've seen this happen and I narrowed it down to the fact that the email is not sent when associating the customer to the Admin website.
When doing this, the website_id for the customer is 0 and this code is executed in the controller:

if ($customer->getWebsiteId() && (isset($data['account']['sendemail']) || $sendPassToEmail)) {
    $storeId = $customer->getSendemailStoreId();
    if ($isNewCustomer) {
        $customer->sendNewAccountEmail('registered', '', $storeId);
    } elseif ((!$customer->getConfirmation())) {
        // Confirm not confirmed customer
        $customer->sendNewAccountEmail('confirmed', '', $storeId);
    }
}

$customer->getWebsiteId() is 0 so the if statement is skipped.
but when you edit the same customer again, the next piece of code is executed (right below the one I mentioned) and the e-mail is sent.

if (!empty($data['account']['new_password'])) {
    $newPassword = $data['account']['new_password'];
    if ($newPassword == 'auto') {
        $newPassword = $customer->generatePassword();
    }
    $customer->changePassword($newPassword);
    $customer->sendPasswordReminderEmail();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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