PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 1.28.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v1.28.0
2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.10.0 All 48 releases
thinkrank / templates / email-report / email.html.php

email.html.php in ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO 1.28.0, at templates/email-report/email.html.php

134 lines 6.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Email Report Layout
4 *
5 * Receives a $payload array assembled by Email_Report_Renderer.
6 *
7 * Email-client safety notes:
8 * - Inline styles only — Gmail / Outlook / Apple Mail strip / partially
9 * support <style> blocks. Anything that must render reliably is inline.
10 * - Tables for outer layout — most reliable across clients (especially
11 * older Outlook versions).
12 * - The `additional_css` block (Pro-only) is injected as a <style> tag so
13 * advanced agencies can theme without us re-engineering inline rules
14 * every time. The PRD calls out that CSS support varies — that's their
15 * risk to take.
16 *
17 * @var array $payload
18 *
19 * @package ThinkRank
20 */
21
22 declare(strict_types=1);
23
24 if (!defined('ABSPATH')) {
25 exit;
26 }
27
28 $payload = isset($payload) && is_array($payload) ? $payload : [];
29 $site_title = (string) ($payload['site_title'] ?? '');
30 $header_logo = (string) ($payload['header_logo'] ?? '');
31 $header_bg = (string) ($payload['header_bg'] ?? '');
32 $logo_link = (string) ($payload['logo_link'] ?? '');
33 $intro_text = (string) ($payload['intro_text'] ?? '');
34 $sections_html = (string) ($payload['sections_html'] ?? '');
35 $footer_text = (string) ($payload['footer_text'] ?? '');
36 $additional_css = (string) ($payload['additional_css'] ?? '');
37 $cta_url = (string) ($payload['cta_url'] ?? '');
38 $context = (array) ($payload['context'] ?? []);
39 $period_label = (string) ($context['period_label'] ?? '');
40 $is_test = !empty($context['is_test']);
41
42 $header_style = 'padding:24px;text-align:center;';
43 if ($header_bg !== '') {
44 $header_style .= 'background:' . $header_bg . ';';
45 } else {
46 $header_style .= 'background:#0f172a;';
47 }
48
49 $logo_img = $header_logo !== ''
50 ? '<img src="' . esc_url($header_logo) . '" alt="' . esc_attr($site_title) . '" style="max-height:48px;border:0;display:inline-block;" />'
51 : '<span style="font:700 22px/1 -apple-system,Segoe UI,Roboto,sans-serif;color:#ffffff;">'
52 . esc_html($site_title !== '' ? $site_title : 'ThinkRank')
53 . '</span>';
54
55 if ($logo_link !== '') {
56 $logo_img = '<a href="' . esc_url($logo_link) . '" style="text-decoration:none;color:#ffffff;">' . $logo_img . '</a>';
57 }
58 ?>
59 <!doctype html>
60 <html lang="<?php echo esc_attr(str_replace('_', '-', get_locale())); ?>">
61 <head>
62 <meta charset="UTF-8" />
63 <meta name="viewport" content="width=device-width,initial-scale=1" />
64 <title><?php echo esc_html($site_title); ?></title>
65 <?php if ($additional_css !== '') : ?>
66 <style type="text/css">
67 <?php echo esc_html($additional_css); ?>
68 </style>
69 <?php endif; ?>
70 </head>
71 <body style="margin:0;padding:0;background:#f4f4f5;-webkit-font-smoothing:antialiased;">
72 <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f4f5;">
73 <tr>
74 <td align="center" style="padding:32px 12px;">
75
76 <?php if ($is_test) : ?>
77 <table role="presentation" width="640" cellpadding="0" cellspacing="0" style="max-width:640px;width:100%;margin:0 0 12px 0;">
78 <tr>
79 <td style="background:#fef3c7;color:#78350f;padding:10px 16px;border-radius:6px;font:500 13px/1.4 -apple-system,Segoe UI,Roboto,sans-serif;">
80 <?php esc_html_e('Test email — this is a preview triggered from the ThinkRank settings.', 'thinkrank'); ?>
81 </td>
82 </tr>
83 </table>
84 <?php endif; ?>
85
86 <table role="presentation" width="640" cellpadding="0" cellspacing="0" style="max-width:640px;width:100%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,0.08);">
87 <tr>
88 <td style="<?php echo esc_attr($header_style); ?>">
89 <?php echo $logo_img; // already escaped above ?>
90 <?php if ($period_label !== '') : ?>
91 <div style="margin-top:8px;color:rgba(255,255,255,0.85);font:500 13px/1.4 -apple-system,Segoe UI,Roboto,sans-serif;">
92 <?php echo esc_html($period_label); ?>
93 </div>
94 <?php endif; ?>
95 </td>
96 </tr>
97
98 <?php if ($intro_text !== '') : ?>
99 <tr>
100 <td style="padding:24px 24px 0 24px;font:400 15px/1.6 -apple-system,Segoe UI,Roboto,sans-serif;color:#374151;">
101 <?php echo wp_kses_post($intro_text); ?>
102 </td>
103 </tr>
104 <?php endif; ?>
105
106 <tr>
107 <td style="padding:24px;font:400 14px/1.6 -apple-system,Segoe UI,Roboto,sans-serif;color:#1f2937;">
108 <?php echo $sections_html; // sections render their own escaped HTML ?>
109 </td>
110 </tr>
111
112 <?php if ($cta_url !== '') : ?>
113 <tr>
114 <td align="center" style="padding:0 24px 28px 24px;">
115 <a href="<?php echo esc_url($cta_url); ?>" style="display:inline-block;background:#2563eb;color:#ffffff;text-decoration:none;font:600 14px/1 -apple-system,Segoe UI,Roboto,sans-serif;padding:12px 22px;border-radius:8px;">
116 <?php esc_html_e('View Full Report', 'thinkrank'); ?>
117 </a>
118 </td>
119 </tr>
120 <?php endif; ?>
121
122 <tr>
123 <td style="padding:18px 24px;background:#f9fafb;color:#6b7280;font:400 12px/1.5 -apple-system,Segoe UI,Roboto,sans-serif;text-align:center;border-top:1px solid #e5e7eb;">
124 <?php echo wp_kses_post($footer_text); ?>
125 </td>
126 </tr>
127 </table>
128
129 </td>
130 </tr>
131 </table>
132 </body>
133 </html>
134