fix: Renderowanie maila

This commit is contained in:
Flatlogic Bot 2026-04-12 05:01:00 +00:00
parent 861955cd7d
commit 6d14698c6c

View File

@ -940,13 +940,23 @@ function diagnostic_strip_legacy_report_cta(array $package): array
'<tr><td style="padding:32px;background:linear-gradient(135deg,#38a7e8 0%,#1d88d4 46%,#0e5fb5 100%);color:#ffffff;">',
$html
);
$html = preg_replace(
'~<div style="margin:0 0 14px;">\s*<a href="[^"]*" style="display:inline-block;text-decoration:none;" aria-label="Przejdź do bloga DoktorBiznes\.pl">\s*<img[^>]+>\s*</a>\s*</div>~u',
'',
$html
) ?? $html;
$html = preg_replace(
'~<div style="display:inline-block;font-size:24px;line-height:1\.2;font-weight:800;color:#ffffff;">DoktorBiznes(?:<span style="color:#ff9c57;">\.pl</span>)?</div>~u',
'',
$html
) ?? $html;
$html = preg_replace(
'~(<tr><td style="padding:32px;background:[^"]*;color:#ffffff;">)(?:\s*<div[^>]*>\s*</div>)*~u',
'$1' . diagnostic_email_brand_marker_html(),
$html,
1
) ?? $html;
if (strpos($html, 'Przejdź do bloga DoktorBiznes.pl') === false) {
if (strpos($html, 'Przejdź do bloga DoktorBiznes.pl') === false && strpos($html, 'DoktorBiznes<span style="color:#ff9c57;">.pl</span>') === false) {
$html = preg_replace(
'~(<tr><td style="padding:32px(?: 32px (?:12|18)px)?;background:[^"]*;color:#ffffff;">)~u',
'$1' . diagnostic_email_brand_marker_html(),