I want to provide more relevant information to the customer in the "New Order" email template dependent on what method of payment was selected when placing the order.
I implemented this method from ʍǝɥʇɐɯ here https://stackoverflow.com/a/6628433 and created /app/design/frontend/default/default/template/paymentstatus/orderemail.phtml
<?php if($this->getData('order')->getStatus()=='pending_payment_tt'): ?>
<p style="font-size:12px; line-height:16px; margin:0;">
<?php echo $this->__('Your Order Status is pending_payment_tt and you paid by Bank Transfer Payment') ?>
</p>
<?php elseif($this->getData('order')->getStatus()=='awaiting_check'): ?>
<p style="font-size:12px; line-height:16px; margin:0;">
<?php echo $this->__('Your Order Status is awaiting_check and you paid by Electronic Check') ?>
</p>
<?php else: ?>
<p style="font-size:12px; line-height:16px; margin:0;">
<?php echo $this->__('Your Order Status is pending and you probably paid by CC') ?>
</p>
<?php endif; ?>
then edited the New Order email template inserting
{{block type='core/template' area='frontend' template='paymentstatus/orderemail.phtml' order=$order}}
This all works well enough, however the actual content of the conditional message resides in a template file and I now want to pull the content from a Custom Variable enabling easier access to editing the message.
If I create a Custom Variable 'payment_comment', how should I insert it into my orderemail.phtml template?
I found this code but am not sure how to integrate it
$comment = Mage::getModel('core/variable')
->setStoreId(Mage::app()->getStore()->getId())
->loadByCode('payment_comment')
->getValue('html');