| 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 |
|
| 18 |
if (empty($orderRef)) { |
| 19 |
$orderRef = !empty($order->invoice_no) ? $order->invoice_no : '#' . $order->id; |
| 20 |
} |
| 21 |
?> |
| 22 |
|
| 23 |
<div class="space_bottom_30"> |
| 24 |
<p> |
| 25 |
<?php |
| 26 |
printf( |
| 27 |
/* translators: %s is customer name */ |
| 28 |
esc_html__('Hello %s,', 'fluent-cart'), |
| 29 |
esc_html($order->customer->full_name) |
| 30 |
); |
| 31 |
?> |
| 32 |
</p> |
| 33 |
<p> |
| 34 |
<?php |
| 35 |
printf( |
| 36 |
/* translators: %s is order reference */ |
| 37 |
esc_html__('This is a friendly reminder that your payment for order %s is still pending.', 'fluent-cart'), |
| 38 |
esc_html($orderRef) |
| 39 |
); |
| 40 |
?> |
| 41 |
</p> |
| 42 |
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="border:1px solid #e5e7eb;border-radius:8px;padding:14px 16px;margin:12px 0 0;"> |
| 43 |
<tbody> |
| 44 |
<tr> |
| 45 |
<td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Order ID', 'fluent-cart'); ?></td> |
| 46 |
<td style="font-size:13px;color:#111827;font-weight:600;padding:0 0 6px;text-align:right;">#<?php echo esc_html($order->id); ?></td> |
| 47 |
</tr> |
| 48 |
<tr> |
| 49 |
<td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Order Reference', 'fluent-cart'); ?></td> |
| 50 |
<td style="font-size:13px;color:#111827;font-weight:600;padding:0 0 6px;text-align:right;"><?php echo esc_html($orderRef); ?></td> |
| 51 |
</tr> |
| 52 |
<tr> |
| 53 |
<td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Outstanding Amount', 'fluent-cart'); ?></td> |
| 54 |
<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> |
| 55 |
</tr> |
| 56 |
<?php if ($dueDate): ?> |
| 57 |
<tr> |
| 58 |
<td style="font-size:13px;color:#6b7280;padding:0;"><?php esc_html_e('Due Date', 'fluent-cart'); ?></td> |
| 59 |
<td style="font-size:13px;color:#111827;font-weight:600;padding:0;text-align:right;"><?php echo esc_html($dueDate); ?></td> |
| 60 |
</tr> |
| 61 |
<?php endif; ?> |
| 62 |
</tbody> |
| 63 |
</table> |
| 64 |
</div> |
| 65 |
|
| 66 |
<?php |
| 67 |
\FluentCart\App\App::make('view')->render('emails.parts.call_to_action_box', [ |
| 68 |
'content' => __('Your order has an outstanding balance. Please complete your payment at your earliest convenience.', 'fluent-cart'), |
| 69 |
'link' => $paymentLink, |
| 70 |
'button_text' => __('Complete Payment', 'fluent-cart'), |
| 71 |
]); |
| 72 |
|