I have created an email template in the custom module, This is the code I have used to add the template.

            <spritzrequestquotation_email_template translate="label" module="sprrequestquotation">
                <label>Request Quotation Email</label>

This is my module folder structure. app/local/Spr/RequestQuotation/

I have created an email template (requestquotation_email_template.html).

Controller code calling the template and sending mail. I am getting an email but mail body is empty.

$emailTemplate = Mage::getModel('core/email_template')->loadDefault('requestquotation_email_template');

    //Getting the Store E-Mail Sender Name.
    $senderName = Mage::getStoreConfig('trans_email/ident_general/name');

    //Getting the Store General E-Mail.
    $senderEmail = Mage::getStoreConfig('trans_email/ident_general/email');

    //Variables for Confirmation Mail.
    $emailTemplateVariables = array(
        'firstname' => 'John',
        'lastname'  => 'D.'
    $emailTemplateVariables['name'] = $fullName;
    $emailTemplateVariables['email'] = $email;

    //Appending the Custom Variables to Template.
    $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);

    //Sending E-Mail to Customers.
    $mail = Mage::getModel('core/email')
     ->setSubject('Request A Quotation')


1 Answer 1


try with below code

        $storeId = 1;
        $customerName = 'john';

        $mailer = Mage::getModel('core/email_template_mailer');

        $emailInfo = Mage::getModel('core/email_info');
        $emailInfo->addTo($to, $customerName);

        $mailer->setSender(Mage::getStoreConfig('<yourpath>', $storeId));

// in case you would like to pass variable data to your template html
            'test' => 'test',



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.