In magento it’s very easy to set the Custom Email Template. and if you don’t want to set the custom email template in magento and just want send email through coding (Send Grid). use send custom mail in magento
Put the below code on controller file or any php file where the email shoot it ..
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('change_password_custom_email'); $emailTemplate->setSenderName('GotechSolution'); $emailTemplate->setSenderEmail('gotechsolution1@gmail.com'); $emailTemplate->setType('html'); $emailTemplate->setTemplateSubject('Password has been changed successfully'); //Create an array of variables to assign to template $emailTemplateVariables = array(); $emailTemplateVariables['msg'] = "Dear Gotechsolution" <br /><br /> Your password has been changed successfully."; $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables); $emailTemplate->send('gotechsolution1@gmail.com', 'gotechsolution',$processedTemplate);
Load the template in xml file.
go to /app/code/CODE-POOL/NameSpace/ModuleName/etc/config.xml
<global> <template> <email> <!-- Change Password Email template --> <change_password_custom_email module="fedexindia"> <label>change password custom email</label> <file>change_password_custom_email.html</file> <type>html</type> </change_password_custom_email> </email> </template> </gloabl>
Create a change_password_custom_email.html file inside the app/locale/en_US/template/email/change_password_custom_email.html and put this code on it.
<!--@subject change password custom email module @--> <div> <p>{{var msg}}.</p> </div>