From 5227a50e010eefd4759297beaafaa87c36afb2cb Mon Sep 17 00:00:00 2001 From: Mihael Date: Thu, 31 Jul 2025 16:46:11 +0200 Subject: [PATCH] add hookActionEmailSendBefore to set bankwire details for mail template --- b2bpayments.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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')); + } + } + }