send transactional email magento -
i'm trying send confirmation email when subscription order created in magento not sending anything. know email configuration fine because when buy regular product receive email. created template on system -> transactional emails , template id=12, on code on class aw_sarp2_model_checkout_type_onepage extends mage_checkout_model_type_onepage call send subs email method never sends email
class aw_sarp2_model_checkout_type_onepage extends mage_checkout_model_type_onepage { public function saveorder() { mage::log("checkout/onepage",null,"onepageemail.log"); $isquotehassubscriptionproduct = mage::helper('aw_sarp2/quote')->isquotehassubscriptionproduct( $this->getquote() ); if (!$isquotehassubscriptionproduct) //here ask if subscribe product {mage::log("checkout/onepage34",null,"onepageemail.log"); return parent::saveorder(); } $this->validate(); $isnewcustomer = false; switch ($this->getcheckoutmethod()) { case self::method_guest:mage::log("checkout/onepage40",null,"onepageemail.log"); $this->_prepareguestquote(); break; case self::method_register:mage::log("checkout/onepage43",null,"onepageemail.log"); $this->_preparenewcustomerquote(); $isnewcustomer = true; break; default:mage::log("checkout/onepage47",null,"onepageemail.log"); $this->_preparecustomerquote(); break; } if ($this->getquote()->getcustomerid()) {mage::log("checkout/onepage52",null,"onepageemail.log"); $this->getquote()->getcustomer()->save(); } #aw_sarp2 override start $service = mage::getmodel('aw_sarp2/sales_service_profile', $this->getquote());mage::log("checkout/onepage56",null,"onepageemail.log"); $service->submitprofile();mage::log("checkout/onepage57",null,"onepageemail.log"); #aw_sarp2 override end $this->getquote()->save();mage::log("checkout/onepage60",null,"onepageemail.log"); if ($isnewcustomer) {mage::log("checkout/onepage61",null,"onepageemail.log"); try { $this->_involvenewcustomer();mage::log("checkout/onepage63",null,"onepageemail.log"); } catch (exception $e) { mage::logexception($e); } } $this->_checkoutsession->setlastquoteid($this->getquote()->getid()) ->setlastsuccessquoteid($this->getquote()->getid()) ->clearhelperdata();mage::log("checkout/onepage71",null,"onepageemail.log"); // add recurring profiles information session $profiles = $service->getrecurringpaymentprofiles();mage::log("checkout/onepage73",null,"onepageemail.log"); if ($profiles) {mage::log("checkout/onepage74",null,"onepageemail.log"); $ids = array(); foreach ($profiles $profile) { $ids[] = $profile->getid(); }mage::log("checkout/onepage78",null,"onepageemail.log"); $this->sendsubscribeemail2();mage::log("checkout/onepage79",null,"onepageemail.log"); $this->_checkoutsession->setlastrecurringprofileids($ids); mage::log("checkout/onepage82",null,"onepageemail.log"); } return $this; } public function sendsubscribeemail2(){ //here try send email $templateid = 12; // set sender information $sendername = mage::getstoreconfig('trans_email/ident_support/name'); $senderemail = mage::getstoreconfig('trans_email/ident_support/email'); $sender = array('name' => $sendername, 'email' => $senderemail); // set recepient information $recepientemail = 'minorandres@gmail.com'; $recepientname = 'test test'; // store id $storeid = mage::app()->getstore()->getid(); // set variables can used in email template $vars = array('customername' => 'test', 'customeremail' => 'minorandres@gmail.com'); $translate = mage::getsingleton('core/translate');mage::log("checkout/onepage103",null,"onepageemail.log"); // send transactional email mage::getmodel('core/email_template') ->sendtransactional($templateid, $sender, $recepientemail, $recepientname, $vars, $storeid);mage::log("checkout/onepage106",null,"onepageemail.log"); if (!mage::getmodel('core/email_template')->getsentsuccess()) { mage::log("exception!!!! =( checkout/onepage107",null,"onepageemail.log"); } is there in xml files have or other place?, please me
since dealing subscription products handle different smtp provider, on exception.log got , error "mandril cant send email" went admin panel , under system>transactional emails has subtab called mandril configured tool , create account on mandril, put api key indicaded mandril system>configuration>mandril(on left side).
Comments
Post a Comment