With the IF and DEPEND directives in Magento's email templates (System->Transactional Emails), you can conveniently control the output of individual content depending on certain conditions.
However, this only works with "Boolean" query values, i.e. by distinguishing between "true" and "false" or between the values "not equal to 0" and "0" (e.g. {{depend order.getIsNotVirtual()}}). If, for example, you want to display a block depending on whether the payment method is payment in advance, you need to make some preparations. Since the "order" directive in Magento's email templates does nothing other than reference the Mage_Sales_Model_Order class defined in \app\code\core\Mage\Sales\Model\Order.php, you could retrieve the code of the selected payment method using the directive {{var order.getPayment().getMethodInstance().getCode()}}, but you cannot do anything further with it within an IF or DEPEND statement. This is where it helps to add a small function to the Mage_Sales_Model_Order class (which you hopefully copied beforehand from \app\code\core\Mage\Sales\Model\Order.php to \app\code\local\Mage\Sales\Model\Order.php):
public function isCheckmo() {
if ($this->getPayment()->getMethodInstance()->getCode() == 'checkmo') {
return true;
} else {
return false;
}
