I'm using sendTransactional() to send emails programmatically. All working fine beside the variable {{var payment_html}} is empty.

How to pass this value?

below is the code I'm using now.

private function dosend($order, $templateId)
    // Set sender information
    $senderName = Mage::getStoreConfig('trans_email/ident_general/name');
    $senderEmail = Mage::getStoreConfig('trans_email/ident_general/email');
    $sender = array(
        'name' => $senderName,
        'email' => $senderEmail

    // Set recepient information
    $recepientEmail = $order->getCustomerEmail();
    $recepientName = $order->getCustomerFirstname();

    // Get Store ID
    $storeId = Mage::app()->getStore()->getId();

    $vars = array(
        'order' => $order,

    $translate  = Mage::getSingleton('core/translate');
    // Send Transactional Email

        ->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
        ->sendTransactional($templateId, $sender, $recepientEmail, $recepientName, $vars, $storeId)


1 Answer 1


Check out this block of code in /app/code/core/Mage/Sales/Model/Order.php

Generating the payment_html: https://github.com/engineyard/magento-ce-1.9/blob/170c1a51387428fb56f3ada2504d52a2b130360a/app/code/core/Mage/Sales/Model/Order.php#L1282-L1296

Injecting it into the template: https://github.com/engineyard/magento-ce-1.9/blob/170c1a51387428fb56f3ada2504d52a2b130360a/app/code/core/Mage/Sales/Model/Order.php#L1330-L1339

This is not required, but a nice to have: Generating a custom info payment block http://excellencemagentoblog.com/blog/2011/10/28/magento-create-custom-payment-method/

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.