
I have create a html template and send mail. For Magento Custom Email with html email template ,Please follow the below steps
Step1:first define html template in your config.xml so add the below code first in your module config.xml
vendor_account_new.html html
Here vendor_create_account_email_template is always unique and vendor_account_new.html is html file for email.
Step2:Get Current store id
$storeId=Mage::app()->getStore()->getId();
Step3: Sender() parameters should be in array format array(email =>(string) $senderemail,name => (string) $sendername);
$storeId=Mage::app()->getStore()->getId(); $Vendor=Mage::getModel('vendor/vendor')->load(57); /** @var $mailer Mage_Core_Model_Email_Template_Mailer */ $mailer = Mage::getModel('core/email_template_mailer'); $emailInfo = Mage::getModel('core/email_info'); $emailInfo->addTo((string)$Vendor->getEmail(),(string) $Vendor->getName()); $mailer->addEmailInfo($emailInfo); // Set all required params and send emails $mailer->setSender(array('email'=>(string) 'dev.amitbera@gmail.com','name'=> (string)'Bal ta')); $mailer->setStoreId($storeId); $mailer->setTemplateId((string) 'vendor_account_create_template'); $mailer->setTemplateParams(array('vendor'=>$Vendor)); $mailer->send();
Step4: And code of html which are located in applocaleyour languagetemplateemailvendor_account_new.html html
|
About Author:
Kalpesh Chavada
Kalpesh Chavada is Our Founder & CEO of Akshar Group Technologies. He is serving with 11+ years of experience in different technologies like Magento, WordPress, Laravel, jQuery, Shopify, Branding, and Digital Marketing. He is very good with creative logic and always ready to take on challenges.
