How to Debug an Email Template in Magento

debugemailemail-templatesPHP

I am working on modifying email templates. {themeName}/template/email/order/items/order/default.phtml

The above template triggers when the user (guest or customer) has placed the order.

In the above template, there are some variables like:

$_item = $this->getItem();
$_order = $this->getItem()->getOrder(); 

if I use any debugging methods like Mage::log or zend_debug::dump, the checkout page is hanging up and the order is never being processed.

So, my question is what should I use to debug email templates here?

I also used echo which is always showing an empty string or array for an array holding variable.

Best Answer

On the hackathon we (read as they :-)) implemented a module to preview mail templates: https://github.com/magento-hackathon/E-MailPreview

Maybe this helps.