Refactor code structure for improved readability and maintainability

This commit is contained in:
2025-04-18 00:02:27 +02:00
parent a1703a9702
commit 8b79a8399d
8 changed files with 16316 additions and 16601 deletions

View File

@@ -479,11 +479,11 @@ class Ps_Emailsubscription extends Module implements WidgetInterface
}
if ($code = Configuration::get('NW_VOUCHER_CODE')) {
$this->sendVoucher($email, $code);
// $this->sendVoucher($email, $code);
}
if (Configuration::get('NW_CONFIRMATION_EMAIL')) {
$this->sendConfirmationEmail($email);
$this->sendConfirmationEmail($email, $code);
}
}
}
@@ -819,20 +819,17 @@ class Ps_Emailsubscription extends Module implements WidgetInterface
*
* @return bool
*/
protected function sendConfirmationEmail($email)
protected function sendConfirmationEmail($email, $code)
{
$language = new Language($this->context->language->id);
return Mail::send(
$this->context->language->id,
'newsletter_conf',
$this->trans(
'Newsletter confirmation',
[],
'Emails.Subject',
$language->locale
),
[],
'Potwierdzenie zapisu do newslettera',
[
'{discount}' => $code,
],
pSQL($email),
null,
null,