| 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 |
$orderRef = !empty($order->invoice_no) ? $order->invoice_no : '#' . $order->id; |
| 16 |
?> |
| 17 |
|
| 18 |
<div class="space_bottom_30"> |
| 19 |
<p><?php esc_html_e('An invoice due reminder was sent to a customer.', 'fluent-cart'); ?></p> |
| 20 |
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="border:1px solid #e5e7eb;border-radius:8px;padding:14px 16px;margin:12px 0 0;"> |
| 21 |
<tbody> |
| 22 |
<tr> |
| 23 |
<td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Order ID', 'fluent-cart'); ?></td> |
| 24 |
<td style="font-size:13px;color:#111827;font-weight:600;padding:0 0 6px;text-align:right;">#<?php echo esc_html($order->id); ?></td> |
| 25 |
</tr> |
| 26 |
<tr> |
| 27 |
<td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Order Reference', 'fluent-cart'); ?></td> |
| 28 |
<td style="font-size:13px;color:#111827;font-weight:600;padding:0 0 6px;text-align:right;"><?php echo esc_html($orderRef); ?></td> |
| 29 |
</tr> |
| 30 |
<tr> |
| 31 |
<td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Customer', 'fluent-cart'); ?></td> |
| 32 |
<td style="font-size:13px;color:#111827;font-weight:600;padding:0 0 6px;text-align:right;"><?php echo esc_html($order->customer->full_name); ?></td> |
| 33 |
</tr> |
| 34 |
<tr> |
| 35 |
<td style="font-size:13px;color:#6b7280;padding:0 0 6px;"><?php esc_html_e('Amount Due', 'fluent-cart'); ?></td> |
| 36 |
<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> |
| 37 |
</tr> |
| 38 |
<?php if ($dueDate): ?> |
| 39 |
<tr> |
| 40 |
<td style="font-size:13px;color:#6b7280;padding:0;"><?php esc_html_e('Due Date', 'fluent-cart'); ?></td> |
| 41 |
<td style="font-size:13px;color:#111827;font-weight:600;padding:0;text-align:right;"><?php echo esc_html($dueDate); ?></td> |
| 42 |
</tr> |
| 43 |
<?php endif; ?> |
| 44 |
</tbody> |
| 45 |
</table> |
| 46 |
</div> |
| 47 |
|
| 48 |
<?php |
| 49 |
\FluentCart\App\App::make('view')->render('emails.parts.call_to_action_box', [ |
| 50 |
'content' => __('Review the order and follow up if needed.', 'fluent-cart'), |
| 51 |
'link' => $order->getViewUrl('admin'), |
| 52 |
'button_text' => __('View Order', 'fluent-cart'), |
| 53 |
]); |
| 54 |
|