2026 Executive BenchmarkMid-Market Enterprise Modernization: How leaders across unify Commerce, Odoo ERP & AI in 90 days.
MAGENTO COMMERCE

Magento custom email with html email template

Step 1: Create a html template and send mail using For Magento Custom Email with html email template ,Please follow the below steps Step1:first define html template in your config....

Akshar Group Technologies
Dec 25, 2020
2 min read
Verified Source

Step 1: Create a html template and send mail using

code
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 -> New account 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
php
$storeId=Mage::app()->getStore()->getId();
Step3: Sender() parameters should be in array format
php
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

|

Dear ,

Welcome to . 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:

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 or by phone at .

|

Thank you again,

|

|
Share this playbook
LET'S BUILD WHAT'S NEXT

What's Holding Your Business Back?

Tell us where you want to go, what's getting in the way, and we'll help you figure out the technology to get there.

No sales pitch. Confidential strategic advisory.