magento-custom-post-

Step 1: Create a html template and send mail using

 Mage::getModel('core/email_template_mailer');

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.

template>    
                    
                    vendor_account_new.html
                    html

Here vendor_create_account_email_template is always unique and vendor_account_new.htmlis 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

{{var logo_alt}}
 

Dear {{htmlescape var=$vendor.name}},

 

Welcome to {{var store.getFrontendName()}}. To log in when visiting our site just click Login or My Account at the top of every page, and then enter your e-mail address and password.

 

Use the following values when prompted to log in:
E-mail: {{var vendor.email}}
Password: {{htmlescape var=$vendor.password}}

 

When you log in to your account, you will be able to do the following:

 

    • – Proceed through checkout faster when making a purchase

 

    • – Check the status of orders

 

    • – View past orders

 

    • – Make changes to your account information

 

    • – Change your password

 

    • – Store alternative addresses (for shipping to multiple family members and friends!)

 

 

If you have any questions about your account or any other matter, please feel free to contact us at {{config path=’trans_email/ident_support/email’}} or by phone at {{config path=’general/store_information/phone’}}.

 

Thank you again, {{var store.getFrontendName()}}

 

 

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.

Kalpesh Author