How to Install Custom Transactional Email for your Magento website?

If you are owner of an online store, you should know about custom transactional email. It brings multiple benefits such as improving customer confidence, decreasing burdens on other customer service channels, better branding opportunities, being a referral channel, increasing revenue, increasing awareness about customers. With huge benefits like that, there is no reason to ignore installing custom transactional email for your website.

Below, we cover all steps to install it in Magento which you can customize using Ad transactional email section in Magento.

You just need to do forwards following steps seriously.

Step 1:

Create a new module under your local folder, in this case under /app/local/Scommerce/CustomEmail.

Step 2:

Register the module in etc/modules directory and in Scommerce_All.xml or Scommerce_CustomEmail.xml by using code below:



Build config.xml under etc directory of your module /app/local/Scommerce/CustomEmail/etc/config.xml by using the code below:

<?xml version="1.0" encoding="UTF-8"?>
                <scommerce_customemail_custom_email_template translate='label' module='customemail'>
                    <label>Custom Email</label>

With above declaration, Magento knows that you have system configuration in scommerce_customemail→ custom→ email_template xpath. It will appear in system.xml. You must ensure that this xpath matches with system.xml otherwise it is not going to work. This is an important configuration so you have to be careful.

Step 4:

Build system.xml under your module etc directory /app/local/Scommerce/CustomEmail/etc/system.xml by using code below:

<?xml version="1.0"?>
        <scommerce translate="label" module="customemail">
            <label>Scommerce Configuration</label>
        <scommerce_customemail translate="label">
            <label>Custom Email</label>
                <custom translate="label">
                        <sender_email_identity translate="label">
                            <label>Email Sender</label>
                        <email_template translate="label">
                            <label>Email Template</label>

Step 5:

Send transactional email and use your Model or Controller class by typing code below:

         * Sending email to customer
         * @param type $name
         * @param type $email
         * @return boolean
        private function sendEmail()
            $storeId    = Mage::app()->getStore()->getStoreId();
            $emailId    = $this->helper->getConfigData('sender_email_identity');
            $emailFrom  = $this->helper->getConfigData('email_template');
            $email_address = ''
            /* Sender Name */
            $fromName =Mage::getStoreConfig('trans_email/ident_'.$emailFrom.'/name');
            /* Sender Email */
            $fromEmail = Mage::getStoreConfig('trans_email/ident_'.$emailFrom.'/email');
                    $translate = Mage::getSingleton('core/translate');
                    /* @var $translate Mage_Core_Model_Translate */
                    $emailTemplate = Mage::getModel('core/email_template');
                    /* @var $emailTemplate Mage_Core_Model_Email_Template */
                    $emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $storeId));
                    $emailTemplate->sendTransactional(  $emailId,
                                                        array('email' => $fromEmail, 'name' => $fromName),
                                                        array('custom_var1' => 'Custom Variable Value 1', 'custom_var2' => 'Custom Variable Value 2')
            catch (Exception $e){
                    return false;
            return true;

Step 6:

Create custom_email.html to inform in config.xml under /app/local/en_US/template/email/custom_email.html by using code below:

<style type="text/css">
    body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
   .orange { color:#DB7200; }
<div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
    <table cellspacing="0" cellpadding="0" border="0" width="650">
            <td valign="top">
                    <strong>Hello <span class="orange">{{var custom_var1}}</span></strong>,<br/><br/>
                    {{var custom_var2}}
                  Thank you again for purchasing from My Website.
                Kind Regards</br></br>

Finish all steps above means that you are successful in installing custom transactional email in Magento website. Contact us if you have any questions. Or else visit Magento tutorial to consult others.