custom mail in magento -


i sending custom email admin , works when refresh page following error occurred:

fatal error: call member function send() on non-object app/design/frontend/default/default/template/custom/custom.phtml on line 457   code    $emailadmintemplate  = mage::getmodel('core/email_template')->loaddefault('custom_email_template_to_admin_customproduct'); $emailadmintemplate->setsendername($salesdata['name']); $emailadmintemplate = array(); $emailadmintemplate['name'] = $salesdata['name'] ; $emailadmintemplate['productname'] = $auction->getproductname(); $emailadmintemplate['totalbidder'] = $auction->gettotalbidder(); $emailadmintemplate['startdate']= $gdate ;$emailadmintemplate['starttime']=$ttime ; $emailadmintemplate->send($salesdata['email'],$salesdata['name'],$emailadmintemplate); 

you overwrite var "$emailadmintemplate". model object becomes array of parameters !

$emailadmintemplate  = mage::getmodel('core/email_template')->loaddefault('custom_email_template_to_admin_customproduct'); $emailadmintemplate->setsendername($salesdata['name']); $emailadmintemplateparams = array(); $emailadmintemplateparams['name'] = $salesdata['name'] ; $emailadmintemplateparams['productname'] = $auction->getproductname(); $emailadmintemplateparams['totalbidder'] = $auction->gettotalbidder(); $emailadmintemplateparams['startdate'] = $gdate ; $emailadmintemplateparams['starttime'] = $ttime ; $emailadmintemplate->send($salesdata['email'],$salesdata['name'],$emailadmintemplateparams); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -