Wednesday, May 15, 2013

how to get customer email id from particular group in magento


$collection = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');
$result = array();
$salleremailid=array();
foreach($collection as $customer){
$result[]=$customer->toArray();
  //check sale rep group
if($customer->group_id==4){
   
if($customer->website_id==$websiteId){

$salleremailid[]=$customer->email;
}

}
if($customer->group_id==2){

if($customer->website_id==$websiteId){

$wholesallerpemai=$customer->email;
}

}
}
echo "<pre>";print_r($result);
echo "Rep Email id = ".print_r($Salerepemail)."<br>";
exit;

No comments:

Post a Comment