PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.0
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Views / emails / order / reminder / overdue / customer.php

customer.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.0, at app/Views/emails/order/reminder/overdue/customer.php

95 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (!defined('ABSPATH')) exit; ?>
2 <?php
3 /**
4 * @var \FluentCart\App\Models\Order $order
5 * @var array $reminder
6 */
7
8 $reminder = (isset($reminder) && is_array($reminder)) ? $reminder : [];
9 $dueAt = \FluentCart\Framework\Support\Arr::get($reminder, 'due_at', '');
10 $dueDate = $dueAt ? \FluentCart\App\Services\DateTime\DateTime::gmtToTimezone($dueAt)->format('M d, Y h:i A') : '';
11 $dueAmount = \FluentCart\Framework\Support\Arr::get($reminder, 'due_amount', 0);
12 if (!$dueAmount) {
13 $dueAmount = max(((int)$order->total_amount - (int)$order->total_paid), 0);
14 }
15 $paymentLink = \FluentCart\Framework\Support\Arr::get($reminder, 'payment_link', \FluentCart\App\Services\Payments\PaymentHelper::getCustomPaymentLink($order->uuid));
16 $orderRef = \FluentCart\Framework\Support\Arr::get($reminder, 'order_ref', '');
17 $stage = \FluentCart\Framework\Support\Arr::get($reminder, 'stage', '');
18
19 if (empty($orderRef)) {
20 $orderRef = !empty($order->invoice_no) ? $order->invoice_no : '#' . $order->id;
21 }
22
23 $overdueDays = 0;
24 if (preg_match('/^overdue_(\d+)$/', $stage, $m)) {
25 $overdueDays = (int)$m[1];
26 }
27
28 if ($overdueDays >= 7) {
29 $bodyText = sprintf(
30 /* translators: %1$s: invoice reference, %2$d: number of days overdue */
31 esc_html__('Your subscription invoice %1$s is now %2$d days overdue. If payment is not received soon, your subscription will be suspended.', 'fluent-cart'),
32 '<b>' . esc_html($orderRef) . '</b>',
33 $overdueDays
34 );
35 $ctaText = esc_html__('Your subscription is at risk. Please pay immediately to avoid suspension.', 'fluent-cart');
36 } elseif ($overdueDays >= 3) {
37 $bodyText = sprintf(
38 /* translators: %1$s: invoice reference, %2$d: number of days overdue */
39 esc_html__('Your payment for invoice %1$s is %2$d days overdue. Please complete your payment as soon as possible to keep your subscription active.', 'fluent-cart'),
40 '<b>' . esc_html($orderRef) . '</b>',
41 $overdueDays
42 );
43 $ctaText = esc_html__('Please complete your payment to avoid any disruption to your subscription.', 'fluent-cart');
44 } else {
45 $bodyText = sprintf(
46 /* translators: %1$s: invoice reference */
47 esc_html__('Just a nudge — your payment for invoice %1$s was due recently and is still pending. No worries, you can complete it now.', 'fluent-cart'),
48 '<b>' . esc_html($orderRef) . '</b>'
49 );
50 $ctaText = esc_html__('Complete your payment at your earliest convenience to keep your subscription running smoothly.', 'fluent-cart');
51 }
52 ?>
53
54 <div class="space_bottom_30">
55 <p>
56 <?php
57 printf(
58 /* translators: %s is customer name */
59 esc_html__('Hello %s,', 'fluent-cart'),
60 esc_html($order->customer->full_name)
61 );
62 ?>
63 </p>
64 <p><?php echo wp_kses($bodyText, ['b' => []]); ?></p>
65 <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="border:1px solid #e5e7eb;border-radius:8px;padding:14px 16px;margin:12px 0 0;">
66 <tbody>
67 <tr>
68 <td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Order ID', 'fluent-cart'); ?></td>
69 <td style="font-size:13px;color:#111827;font-weight:600;padding:0 0 6px;text-align:right;">#<?php echo esc_html($order->id); ?></td>
70 </tr>
71 <tr>
72 <td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Order Reference', 'fluent-cart'); ?></td>
73 <td style="font-size:13px;color:#111827;font-weight:600;padding:0 0 6px;text-align:right;"><?php echo esc_html($orderRef); ?></td>
74 </tr>
75 <tr>
76 <td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Outstanding Amount', 'fluent-cart'); ?></td>
77 <td style="font-size:14px;color:#111827;font-weight:700;padding:0 0 6px;text-align:right;"><?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($dueAmount, null, false, true, true)); ?></td>
78 </tr>
79 <?php if ($dueDate): ?>
80 <tr>
81 <td style="font-size:13px;color:#6b7280;padding:0;"><?php esc_html_e('Due Date', 'fluent-cart'); ?></td>
82 <td style="font-size:13px;color:#111827;font-weight:600;padding:0;text-align:right;"><?php echo esc_html($dueDate); ?></td>
83 </tr>
84 <?php endif; ?>
85 </tbody>
86 </table>
87 </div>
88
89 <?php
90 \FluentCart\App\App::make('view')->render('emails.parts.call_to_action_box', [
91 'content' => $ctaText,
92 'link' => $paymentLink,
93 'button_text' => __('Complete Payment', 'fluent-cart'),
94 ]);
95