Magento

Preview Error for Magento Transactional Emails Line 144

Magento LogoIf you get the below error when you are attempting to preview a new transactional email template that you are working on in Admin > System > Transactional Emails, don’t worry.  Nobody likes that sinking feel you get when you break something in Magento.  Fortunately, this one is an easy fix, the fix is right below the warning text at the bottom of the post.

Error Message:

Warning: include(/home/development/public_html/app/design/adminhtml/default/default/template/email/order/shipment/items.phtml) [function.include]: failed to open stream: No such file or directory  in /home/development/public_html/app/code/core/Mage/Core/Block/Template.php on line 144
Trace:
#0 /home/development/public_html/app/code/core/Mage/Core/Block/Template.php(144): mageCoreErrorHandler(2, 'include(/home/k...', '/home/development/p...', 144, Array)
#1 /home/development/public_html/app/code/core/Mage/Core/Block/Template.php(144): Mage_Core_Block_Template::fetchView()
#2 /home/development/public_html/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#3 /home/development/public_html/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#4 /home/development/public_html/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#5 /home/development/public_html/app/code/core/Mage/Core/Model/Layout.php(526): Mage_Core_Block_Abstract->toHtml()
#6 /home/development/public_html/app/code/core/Mage/Core/Model/Email/Template/Filter.php(111): Mage_Core_Model_Layout->getOutput()
#7 /home/development/public_html/lib/Varien/Filter/Template.php(128): Mage_Core_Model_Email_Template_Filter->layoutDirective(Array)
#8 /home/development/public_html/app/code/core/Mage/Core/Model/Email/Template.php(282): Varien_Filter_Template->filter(Array, Array)
#9 /home/development/public_html/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php(50): Mage_Core_Model_Email_Template->getProcessedTemplate('

To fix the error simply locate the following line of code in the transactional email template that you are trying to create:

{{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}}

And remove “shipment_” so that it now looks like the code below:

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

You will now be able to preview the transactional email template without errors.

Leave a Reply

Your email address will not be published. Required fields are marked *