I'm just going to leave this answer here for Magento 2...
I have set up a custom module which includes the ability to add bank details to the email. There are many resources online which detail how to set up a custom module so I am just going to add the specific files related to the question here:
In the email template add the following:
{{layout area="frontend" handle="banktransfer_email_template_message" order=$order }}
Then in your module add the following file:
app/code/Vendor/ModuleName/view/frontend/layout/banktransfer_email_template_message.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"
label="Bank Transfer Email Template Message"
design_abstraction="custom">
<body>
<block class="Vendor\ModuleName\Block\View"
name="vendor.modulename.email.template.message"
template="Vendor_ModuleName::email/banktransfer/message.phtml">
</block>
</body>
Then add the View class:
app/code/Vendor/ModuleName/Block/View.php
<?php
namespace Vendor\ModuleName\Block;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
class View extends Template
{
/**
* @var ScopeConfigInterface
* */
private $scopeConfig;
public function __construct(
Context $context,
array $data = []
) {
parent::__construct(
$context,
$data
);
$this->scopeConfig = $context->getScopeConfig();
}
/**
* @return mixed
*/
public function getAdditionalInfoMessageFromConfig() {
/** I have added a custom field to admin where I retrieve the
* bank details but you can enter your bank details in the text
* field already given in
* Stores/Configuration/Sales/Payment Methods/Bank Transfer/Instructions text field */
return $this->scopeConfig->getValue('payment/banktransfer/instructions', ScopeInterface::SCOPE_STORE);
}
}
Add the template file:
app/code/Vendor/ModuleName/view/frontend/templates/email/banktransfer/message.phtml
<?php
/** @var \Vendor\ModuleName\Block\View $block */
?>
<div class="bank-transfer-email-message">
<?php
$var = $block->getData('order')->getPayment()->getMethodInstance()->getCode();
if ($var == 'banktransfer') {
echo $block->getAdditionalInfoMessageFromConfig();
}
?>
</div>
Hope this helps someone in the future!