0

I am trying to create API for customer signup. I works perfectly but now i need to add one more functionality. i want to sent customer confirmation mail when customer register. i have tried all but result are null.

$session =  $client->login($apiuser, $apikey);
try{
    $result = $client->call($session,'customer.create',array(array('email' => "$email", 'firstname' => "$firstname", 'lastname' => "$lastname", 'password' => "$password", 'website_id' => "$websiteId", 'store_id' => "$storeId", 'group_id' => 1)));
    if($result){
        $cust = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($email);
        $cust->sendNewAccountEmail('confirmed');
        echo json_encode("New Customer created with Id-$result");
    }
}
   catch( Exception $e ) {
    echo json_encode($e->getMessage());
}

My above code create customer successfully but not work for mail confirmation.

1 Answer 1

0

Try below code...

$cust->sendNewAccountEmail(
            'confirmation', 
            '', 
            Mage::app()->getStore()->getId()
        );

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.