| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template Name: Email content section. |
| 4 |
* |
| 5 |
* Expected variables (passed from Cartflows_Admin_Report_Emails::get_email_content()): |
| 6 |
* - $user_name (string) Recipient display name. |
| 7 |
* - $from_date (string) 7-day window start label (e.g. "May 27"). |
| 8 |
* - $to_date (string) 7-day window end label (e.g. "Jun 3"). |
| 9 |
* - $total_revenue (string) Weekly revenue HTML from wc_price(). |
| 10 |
* - $total_orders (int|string) Weekly order count. |
| 11 |
* - $total_visits (int|string) Weekly visits count (Pro only; "0" on Free). |
| 12 |
* - $order_bump_revenue (string) Bump revenue HTML from wc_price() (Pro only). |
| 13 |
* - $offers_revenue (string) Offers revenue HTML from wc_price() (Pro only). |
| 14 |
* - $last_month_revenue (string) 30-day revenue HTML from wc_price(). |
| 15 |
* |
| 16 |
* @package CartFlows |
| 17 |
*/ |
| 18 |
|
| 19 |
if ( ! defined( 'ABSPATH' ) ) { |
| 20 |
exit; |
| 21 |
} |
| 22 |
|
| 23 |
// Defensive defaults so the template renders without notices if a variable is missing. |
| 24 |
$user_name = isset( $user_name ) ? $user_name : ''; |
| 25 |
$from_date = isset( $from_date ) ? $from_date : ''; |
| 26 |
$to_date = isset( $to_date ) ? $to_date : ''; |
| 27 |
$total_revenue = isset( $total_revenue ) ? $total_revenue : ''; |
| 28 |
$total_orders = isset( $total_orders ) ? $total_orders : 0; |
| 29 |
$total_visits = isset( $total_visits ) ? $total_visits : 0; |
| 30 |
$order_bump_revenue = isset( $order_bump_revenue ) ? $order_bump_revenue : ''; |
| 31 |
$offers_revenue = isset( $offers_revenue ) ? $offers_revenue : ''; |
| 32 |
$last_month_revenue = isset( $last_month_revenue ) ? $last_month_revenue : ''; |
| 33 |
?> |
| 34 |
<tr> |
| 35 |
<td class="px-lg modern-sans" style="padding:24px 40px 0 40px; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif;"> |
| 36 |
<p style="margin:0; font-size:22px; font-weight:700; color:#0f172a; line-height:1.3; letter-spacing:-0.01em;"> |
| 37 |
<?php |
| 38 |
/* translators: %s: user display name. */ |
| 39 |
echo sprintf( esc_html__( 'Hi %s', 'cartflows' ), esc_html( $user_name ) ); |
| 40 |
?> |
| 41 |
</p> |
| 42 |
<p style="margin:8px 0 0 0; font-size:14px; color:#64748b; line-height:1.6;"> |
| 43 |
<?php echo esc_html__( 'Quick report on how your store performed this week.', 'cartflows' ); ?> |
| 44 |
</p> |
| 45 |
</td> |
| 46 |
</tr> |
| 47 |
|
| 48 |
<!-- Section: Last 7 Days --> |
| 49 |
<tr> |
| 50 |
<td class="px-lg" style="padding:36px 40px 0 40px;"> |
| 51 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 52 |
<tr> |
| 53 |
<td valign="bottom" class="modern-sans" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:15px; font-weight:700; color:#0f172a; letter-spacing:-0.01em;"> |
| 54 |
<?php echo esc_html__( 'Last 7 days', 'cartflows' ); ?> |
| 55 |
</td> |
| 56 |
<td valign="bottom" align="right" class="modern-sans" style="font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:13px; color:#94a3b8;"> |
| 57 |
<?php echo esc_html( $from_date . ' – ' . $to_date ); ?> |
| 58 |
</td> |
| 59 |
</tr> |
| 60 |
</table> |
| 61 |
</td> |
| 62 |
</tr> |
| 63 |
|
| 64 |
<!-- 2-column hero KPI cards: Total revenue + Orders placed --> |
| 65 |
<tr> |
| 66 |
<td class="px-lg" style="padding:16px 40px 0 40px;"> |
| 67 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 68 |
<tr> |
| 69 |
<td class="stack" valign="top" width="50%" style="padding-right:8px;"> |
| 70 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:#fff8f3; border:1px solid #fde8d8; border-radius:12px;"> |
| 71 |
<tr> |
| 72 |
<td align="center" style="padding:28px 20px;"> |
| 73 |
<p class="hero-num modern-sans" style="margin:0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:36px; font-weight:700; color:#0f172a; line-height:1; letter-spacing:-0.025em;"> |
| 74 |
<?php echo wp_kses_post( $total_revenue ); ?> |
| 75 |
</p> |
| 76 |
<p class="modern-sans" style="margin:10px 0 0 0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:13px; color:#64748b; line-height:1.4;"> |
| 77 |
<?php echo esc_html__( 'Total revenue', 'cartflows' ); ?> |
| 78 |
</p> |
| 79 |
</td> |
| 80 |
</tr> |
| 81 |
</table> |
| 82 |
</td> |
| 83 |
<td class="stack stack-last" valign="top" width="50%" style="padding-left:8px;"> |
| 84 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:#fff8f3; border:1px solid #fde8d8; border-radius:12px;"> |
| 85 |
<tr> |
| 86 |
<td align="center" style="padding:28px 20px;"> |
| 87 |
<p class="hero-num modern-sans" style="margin:0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:36px; font-weight:700; color:#0f172a; line-height:1; letter-spacing:-0.025em;"> |
| 88 |
<?php echo esc_html( number_format_i18n( (int) $total_orders ) ); ?> |
| 89 |
</p> |
| 90 |
<p class="modern-sans" style="margin:10px 0 0 0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:13px; color:#64748b; line-height:1.4;"> |
| 91 |
<?php echo esc_html__( 'Orders placed', 'cartflows' ); ?> |
| 92 |
</p> |
| 93 |
</td> |
| 94 |
</tr> |
| 95 |
</table> |
| 96 |
</td> |
| 97 |
</tr> |
| 98 |
</table> |
| 99 |
</td> |
| 100 |
</tr> |
| 101 |
|
| 102 |
<!-- 3-column KPI cards: Total visits + Order bumps + Offers revenue --> |
| 103 |
<tr> |
| 104 |
<td class="px-lg" style="padding:16px 40px 0 40px;"> |
| 105 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 106 |
<tr> |
| 107 |
<td class="stack" valign="top" width="33.33%" style="padding-right:6px;"> |
| 108 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:#fafafa; border:1px solid #ececec; border-radius:12px;"> |
| 109 |
<tr> |
| 110 |
<td align="center" style="padding:22px 16px;"> |
| 111 |
<p class="kpi-num modern-sans" style="margin:0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:28px; font-weight:700; color:#0f172a; line-height:1; letter-spacing:-0.02em;"> |
| 112 |
<?php echo esc_html( number_format_i18n( (int) $total_visits ) ); ?> |
| 113 |
</p> |
| 114 |
<p class="modern-sans" style="margin:8px 0 0 0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:12px; color:#64748b; line-height:1.4;"> |
| 115 |
<?php echo esc_html__( 'Total visits', 'cartflows' ); ?> |
| 116 |
</p> |
| 117 |
</td> |
| 118 |
</tr> |
| 119 |
</table> |
| 120 |
</td> |
| 121 |
<td class="stack" valign="top" width="33.33%" style="padding:0 6px;"> |
| 122 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:#fafafa; border:1px solid #ececec; border-radius:12px;"> |
| 123 |
<tr> |
| 124 |
<td align="center" style="padding:22px 16px;"> |
| 125 |
<p class="kpi-num modern-sans" style="margin:0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:28px; font-weight:700; color:#0f172a; line-height:1; letter-spacing:-0.02em;"> |
| 126 |
<?php echo wp_kses_post( $order_bump_revenue ); ?> |
| 127 |
</p> |
| 128 |
<p class="modern-sans" style="margin:8px 0 0 0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:12px; color:#64748b; line-height:1.4;"> |
| 129 |
<?php echo esc_html__( 'Order bumps', 'cartflows' ); ?> |
| 130 |
</p> |
| 131 |
</td> |
| 132 |
</tr> |
| 133 |
</table> |
| 134 |
</td> |
| 135 |
<td class="stack stack-last" valign="top" width="33.33%" style="padding-left:6px;"> |
| 136 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:#fafafa; border:1px solid #ececec; border-radius:12px;"> |
| 137 |
<tr> |
| 138 |
<td align="center" style="padding:22px 16px;"> |
| 139 |
<p class="kpi-num modern-sans" style="margin:0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:28px; font-weight:700; color:#0f172a; line-height:1; letter-spacing:-0.02em;"> |
| 140 |
<?php echo wp_kses_post( $offers_revenue ); ?> |
| 141 |
</p> |
| 142 |
<p class="modern-sans" style="margin:8px 0 0 0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:12px; color:#64748b; line-height:1.4;"> |
| 143 |
<?php echo esc_html__( 'Offers revenue', 'cartflows' ); ?> |
| 144 |
</p> |
| 145 |
</td> |
| 146 |
</tr> |
| 147 |
</table> |
| 148 |
</td> |
| 149 |
</tr> |
| 150 |
</table> |
| 151 |
</td> |
| 152 |
</tr> |
| 153 |
|
| 154 |
<!-- Section: Last 30 Days --> |
| 155 |
<tr> |
| 156 |
<td class="px-lg" style="padding:32px 40px 0 40px;"> |
| 157 |
<p class="modern-sans" style="margin:0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:15px; font-weight:700; color:#0f172a; letter-spacing:-0.01em;"> |
| 158 |
<?php echo esc_html__( 'Last 30 days', 'cartflows' ); ?> |
| 159 |
</p> |
| 160 |
</td> |
| 161 |
</tr> |
| 162 |
|
| 163 |
<!-- Full-width 30-day card --> |
| 164 |
<tr> |
| 165 |
<td class="px-lg" style="padding:16px 40px 0 40px;"> |
| 166 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:#fff8f3; border:1px solid #fde8d8; border-radius:12px;"> |
| 167 |
<tr> |
| 168 |
<td align="center" style="padding:32px 24px;"> |
| 169 |
<p class="hero-num modern-sans" style="margin:0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:40px; font-weight:700; color:#0f172a; line-height:1; letter-spacing:-0.025em;"> |
| 170 |
<?php echo wp_kses_post( $last_month_revenue ); ?> |
| 171 |
</p> |
| 172 |
<p class="modern-sans" style="margin:10px 0 0 0; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif; font-size:13px; color:#64748b; line-height:1.4;"> |
| 173 |
<?php echo esc_html__( 'Total revenue', 'cartflows' ); ?> |
| 174 |
</p> |
| 175 |
</td> |
| 176 |
</tr> |
| 177 |
</table> |
| 178 |
</td> |
| 179 |
</tr> |
| 180 |
|
| 181 |
<!-- Divider --> |
| 182 |
<tr> |
| 183 |
<td class="px-lg" style="padding:36px 40px 0 40px;"> |
| 184 |
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 185 |
<tr><td height="1" bgcolor="#eeeae3" style="line-height:1px; font-size:1px;"> </td></tr> |
| 186 |
</table> |
| 187 |
</td> |
| 188 |
</tr> |
| 189 |
|