Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user