diff --git a/b2bpayments.php b/b2bpayments.php index ca0005d..eab0af9 100644 --- a/b2bpayments.php +++ b/b2bpayments.php @@ -44,8 +44,9 @@ class B2BPayments extends PaymentModule implements PrestaShop\PrestaShop\Core\Mo { if ( !parent::install() || - !$this->registerHook('paymentOptions') - || !$this->registerHook('DisplayOrderConfirmation') + !$this->registerHook('paymentOptions') || + !$this->registerHook('DisplayOrderConfirmation') || + !$this->registerHook('actionEmailSendBefore') ) { return false; } @@ -411,4 +412,13 @@ class B2BPayments extends PaymentModule implements PrestaShop\PrestaShop\Core\Mo Context::getContext()->customer = $originalCustomer; return $regularPrice; } + + public function hookActionEmailSendBefore($params) + { + if ($params['template'] == 'bankwire_postpaid') { + $params['templateVars']['{bankwire_owner}'] = Configuration::get('BANK_WIRE_OWNER'); + $params['templateVars']['{bankwire_details}'] = nl2br(Configuration::get('BANK_WIRE_DETAILS')); + } + } + }