| 1 |
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?> |
| 2 |
<?php |
| 3 |
/** |
| 4 |
* @var \FluentCart\App\Models\Order $order |
| 5 |
* @var \FluentCart\App\Models\Subscription $subscription |
| 6 |
* @var string|null $error Gateway failure reason |
| 7 |
* @var int|null $attempt Attempt number that failed |
| 8 |
* @var string|null $next_retry_at GMT datetime of the next automatic retry, if any |
| 9 |
*/ |
| 10 |
|
| 11 |
$nextRetryAt = isset($next_retry_at) ? $next_retry_at : null; |
| 12 |
$attemptNo = isset($attempt) ? (int) $attempt : 1; |
| 13 |
?> |
| 14 |
|
| 15 |
<div class="space_bottom_30"> |
| 16 |
<p> |
| 17 |
<?php |
| 18 |
printf( |
| 19 |
/* translators: %1$s is the renewal order number, %2$s is the customer's full name */ |
| 20 |
esc_html__( 'The automatic renewal charge for renewal #%1$s (customer: %2$s) failed.', 'fluent-cart' ), |
| 21 |
esc_html( $order->invoice_no ?: $order->id ), |
| 22 |
esc_html( $order->customer->full_name ) |
| 23 |
); |
| 24 |
?> |
| 25 |
</p> |
| 26 |
|
| 27 |
<p> |
| 28 |
<?php |
| 29 |
printf( |
| 30 |
/* translators: %1$d is the failed attempt number, %2$s is the failure reason */ |
| 31 |
esc_html__( 'Attempt %1$d failed with: %2$s', 'fluent-cart' ), |
| 32 |
(int) $attemptNo, |
| 33 |
'<em>' . esc_html( isset($error) ? $error : '' ) . '</em>' |
| 34 |
); |
| 35 |
?> |
| 36 |
</p> |
| 37 |
|
| 38 |
<p> |
| 39 |
<?php |
| 40 |
if ($nextRetryAt) { |
| 41 |
printf( |
| 42 |
/* translators: %1$s is the date/time of the next automatic charge attempt */ |
| 43 |
esc_html__( 'The next automatic attempt is scheduled for %1$s (GMT).', 'fluent-cart' ), |
| 44 |
'<strong>' . esc_html( $nextRetryAt ) . '</strong>' |
| 45 |
); |
| 46 |
} else { |
| 47 |
esc_html_e( 'No further automatic attempts are scheduled — the renewal order follows the normal overdue flow.', 'fluent-cart' ); |
| 48 |
} |
| 49 |
?> |
| 50 |
</p> |
| 51 |
</div> |
| 52 |
|
| 53 |
<?php |
| 54 |
|
| 55 |
\FluentCart\App\App::make('view')->render('emails.parts.items_table', [ |
| 56 |
'order' => $order, |
| 57 |
'formattedItems' => $order->order_items, |
| 58 |
'heading' => __('Renewal Summary', 'fluent-cart'), |
| 59 |
]); |
| 60 |
|