PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.2.14
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.2.14
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / includes / Admin / Rating / EmailTemplate.php

EmailTemplate.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.2.14, at includes/Admin/Rating/EmailTemplate.php

150 lines 8.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace NotificationX\Admin\Rating;
3
4 class EmailTemplate
5 {
6 public function template_body($data, $frequency) {
7 $rating = $data['rating'] ?? 'N/A';
8 $review = $data['review'] ?? 'No review provided';
9
10 // Fetch Site Owner Info
11 $site_name = get_bloginfo('name');
12 $site_url = get_site_url();
13 $admin_email = get_option('admin_email');
14 $wp_version = get_bloginfo('version');
15
16 $admin_user = get_user_by('ID', 1);
17 if ($admin_user) {
18 $first_name = get_user_meta($admin_user->ID, 'first_name', true);
19 $last_name = get_user_meta($admin_user->ID, 'last_name', true);
20
21 $admin_full_name = trim("$first_name $last_name");
22
23 // Fallback to display name if full name is not set
24 if (empty($admin_full_name)) {
25 $admin_full_name = $admin_user->display_name;
26 }
27 } else {
28 $admin_full_name = 'Unknown';
29 }
30
31 // phpcs:disable PluginCheck.CodeAnalysis.Offloading.OffloadedContent -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16.
32 // phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet -- HTML email body; wp_enqueue_style() has no effect in a mail. Audited 2026-07-16.
33 $emailTemplate = '
34 <!DOCTYPE html>
35 <html lang="en">
36 <head>
37 <meta charset="UTF-8">
38 <meta name="viewport" content="width=device-width, initial-scale=1.0">
39 <title>NotificationX Feedback Received</title>
40 <link href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap" rel="stylesheet">
41 <style>
42 @media (max-width: 600px) {
43 .notificationx-email-container .notificationx-email-body {
44 width: 100% !important;
45 max-width: 100%;
46 }
47 }
48 </style>
49 </head>
50 <body class="notificationx-email-wrapper" style="background-color: #f3f7fa; margin: 0; padding: 0">
51 <table class="notificationx-email-container" cellpadding="25" cellspacing="0" border="0" width="100%" align="center"
52 bgcolor="#f3f7fa" style="background-color: #f3f7fa; margin: 0; padding: 25px 0 0">
53 <tbody>
54 <tr>
55 <td>
56 <table width="540" cellpadding="0" cellspacing="0" border="0" class="notificationx-email-body" bgcolor="#fff"
57 align="center"
58 style="box-shadow: 0 0 15px rgba(0,0,0,0.15); width: 800px;border-radius: 10px; text-align: left">
59 <tbody>
60 <tr>
61 <td>
62 <table width="100%" cellpadding="0" cellspacing="0" align="center" border="0"
63 style="border-bottom: 1px solid #eee;">
64 <tbody>
65 <tr>
66 <td style="text-align: center; padding: 20px">
67 <a href="https://notificationx.com" target="_blank"
68 style="text-align: center">
69 <img src="https://notificationx.com/wp-content/uploads/2025/02/NotificationX-300x80.png" alt="' . $site_name . ' Logo">
70 </a>
71 </td>
72 </tr>
73 </tbody>
74 </table>
75 </td>
76 </tr>
77 <tr>
78 <td>
79 <table width="100%" cellpadding="0" cellspacing="0" align="center" border="0">
80 <tbody>
81 <tr>
82 <td style="text-align: center; padding: 20px 10px 10px">
83 <h3 style="font-size: 20px; font-weight: 700; font-family: Lato, sans-serif; color: #052d3d;">
84 Feedback Overview</h3>
85 </td>
86 </tr>
87
88 <tr>
89 <td>
90 <table cellpadding="5" cellspacing="2" align="center" border="0" style="border: 1px solid #eee; margin-bottom: 20px; border-collapse: collapse; min-width: 75%">
91 <tr>
92 <td colspan="2" style="border-bottom: 1px solid #eee; text-align:left; padding: 6px 15px;">
93 <strong style="font-size: 16px; font-family: Lato, sans-serif; color: #052d3d;">Email:</strong>
94 <a href="mailto:' . $admin_email . '">' . $admin_email . '</a>
95 </td>
96 </tr>
97 <tr>
98 <td style="border-bottom: 1px solid #eee; padding: 6px 15px">
99 <strong style="font-size: 16px; font-family: Lato, sans-serif; color: #052d3d;">Rating:</strong>
100 <span style="font-size: 16px; font-family: Lato, sans-serif; color: #052d3d;">
101 ' . $rating . '
102 </span>
103 </td>
104 </tr>
105 <tr>
106 <td colspan="2" style="border-bottom: 1px solid #eee;text-align:left; padding: 6px 15px;">
107 <strong style="font-size: 16px; font-family: Lato, sans-serif; color: #052d3d;">User:</strong>
108 <a target="_blank">' . $admin_full_name . '</a>
109 </td>
110 </tr>
111 <tr>
112 <td colspan="2" style="border-bottom: 1px solid #eee;text-align:left; padding: 6px 15px;">
113 <strong style="font-size: 16px; font-family: Lato, sans-serif; color: #052d3d;">Site URL:</strong>
114 <a href="' . $site_url . '" target="_blank">' . $site_url . '</a>
115 </td>
116 </tr>
117 <tr>
118 <td colspan="2" style="text-align:left;padding: 6px 15px">
119 <strong style="font-size: 16px; font-family: Lato, sans-serif; color: #052d3d;">Feedback:</strong>
120 </td>
121 </tr>
122 <tr>
123 <td colspan="2" style="border-bottom: 1px solid #eee;text-align: justify; padding: 8px 15px">
124 <span style="font-size: 16px; font-family: Lato, sans-serif; color: #052d3d;">
125 ' . nl2br($review) . '
126 </span>
127 </td>
128 </tr>
129 </table>
130 </td>
131 </tr>
132 </tbody>
133 </table>
134 </td>
135 </tr>
136 </tbody>
137 </table>
138 </td>
139 </tr>
140 </tbody>
141 </table>
142 </body>
143 </html>';
144 // phpcs:enable WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
145 // phpcs:enable PluginCheck.CodeAnalysis.Offloading.OffloadedContent
146
147 return $emailTemplate;
148 }
149 }
150