Refactor code structure for improved readability and maintainability

This commit is contained in:
2025-04-18 00:02:10 +02:00
parent 66b8b0c58a
commit f122df3439
5 changed files with 28 additions and 5426 deletions

View File

@@ -164,8 +164,8 @@
<tbody>
<tr>
<td style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; direction: ltr; font-size: 0px; padding: 0 0 30px; text-align: center;" align="center">
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><![endif]-->
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><![endif]-->
<!-- LOGO BEGINING -->
<!--[if mso | IE]><tr><td class="" width="604px" ><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:604px;" width="604" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
<div style="margin:0px auto;max-width:604px;">
@@ -203,8 +203,8 @@
</div>
<!--[if mso | IE]></td></tr></table></td></tr><![endif]-->
<!-- LOGO ENDING -->
<!--[if mso | IE]><tr><td class="" width="604px" ><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:604px;" width="604" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
<div style="margin:0px auto;max-width:604px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
@@ -287,7 +287,11 @@
<tbody>
<tr>
<td align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-size: 0px; padding: 10px 25px; word-break: break-word;">
<div style="font-family:Open sans, arial, sans-serif;font-size:14px;font-weight:600;line-height:25px;text-align:left;color:#363A41;" align="left">Dziękujemy za zapisanie się do naszego newslettera</div>
<div style="font-family:Open sans, arial, sans-serif;font-size:14px;font-weight:600;line-height:25px;text-align:left;color:#363A41;" align="left">
Dziękujemy za zapisanie się do newslettera <b>Dr Materac!</b> Teraz będziesz na bieżąco z najlepszymi ofertami, nowościami i poradami dotyczącymi zdrowego snu.<br><br>
🎁 Oto Twój kod rabatowy na pierwsze zakupy: <b>{discount}</b><br><br>
Wykorzystaj go na <b>drmaterac.pl</b> i ciesz się komfortowym snem!
</div>
</td>
</tr>
</tbody>
@@ -305,18 +309,18 @@
</div>
<!--[if mso | IE]></td></tr></table></td></tr><![endif]-->
<!-- MESSAGE BOX ENDING -->
<!--[if mso | IE]></table><![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]></td></tr></table><![endif]-->
<!--[if mso | IE]></td></tr></table><![endif]-->
<!-- SHOP NAME BEGINING -->
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:604px;" width="604" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
<div style="margin:0px auto;max-width:604px;">
@@ -350,8 +354,8 @@
</div>
<!--[if mso | IE]></td></tr></table><![endif]-->
<!-- SHOP NAME ENDING -->
</div>
</body>

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,