add hookActionEmailSendBefore to set bankwire details for mail template

This commit is contained in:
Mihael
2025-07-31 16:46:11 +02:00
parent 7458f80c53
commit 5227a50e01

View File

@@ -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'));
}
}
}