You can make use of the control-flow if
keyword in email templates to handle outputting blocks for you:
{{if order.getCategoryIsShoes()}}
<p><!-- your content here --></p>
{{else}}
<p><!-- your default content here --></p>
{{/if}}
Of course you'll have to rewrite Mage_Sales_Model_Order
with your own module to create that method:
<?php
class YourCompany_YourModule_Model_Order extends Mage_Sales_Model_Order
{
public function getCategoryIsShoes()
{
//set your shoes category id
$shoesCategoryId = 9;
//get order from registry
$order = Mage::registry('current_order');
foreach($order->getAllItems() as $_item){
if(in_array($shoesCategoryId, $_item->getCategoryIds()){
return true;
}
}
return false;
}
}
The above is an example only - there is probably a much more elegant way to handle this, for instance, extending the category itself to include a tab with transactional email text; or better-yet, a module that allows you to assign that text on a per-category basis. This is just to get the juices flowing.
Some more reading about the email template syntax for control flow statements like depend
and if/else
:
http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/system_email_template/index