0
votes

I am trying to send email programmaticaly with order items grid using

{{layout handle="sales_email_order_items" order=$order}} 

but its not working.it is blank. But

{{htmlescape var=$order.getCustomerName()}} 

show customer name properly.also shipping address ,billing address,payment method etc. are showing properly

what is missing?

Magento ver. 1.9.0.1

Thanks in Advance

1
did you find out why this was happening? I'm having the same issue on the same mage versiondevelophper

1 Answers

0
votes

In your custom module, you must set all required params.

...
$mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId($templateId);
$mailer->setTemplateParams(array(
            'order'        => $this, /* This is just order object. Please check if this object is null or not. */
            'billing'      => $this->getBillingAddress(),
            'payment_html' => $paymentBlockHtml
        )
    );
...