I am trying to send custom email with some variables in it, but don't know what I am doing wrong in it here is my code :

    $emailTemplate  = Mage::getModel('core/email_template');
    /* tried all of the above to load template but same results */

    $processedTemplate = $emailTemplate->getProcessedTemplate($templateVariables);

    try {
        $emailTemplate->send($rec_email, $rec_name, $templateVariables);
    catch(Exception $ex) {
        echo Mage::getSingleton('core/session')->addError($this->__($ex->getMessage()));

I added the template from Magento admin panel transactional emails, haven't created any html file for template.

Email is getting sent but variables are shown as

{{ var sender_name }}

{{ var rcver_name }}

{{ var pr_name }}

{{ var order_number }} 

Please give me an idea of what I am doing wrong.

1 Answer 1


Remove start and end spaces from the template variables like

{{var sender_name}}

{{var rcver_name}}

{{var pr_name}}

{{var order_number}} 

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.