<?php
/**
 * Customer renewal requires verification email plain template.
 *
 * @package ArraySubs\Features\Emails\templates\plain
 */

defined('ABSPATH') || exit;

echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html(wp_strip_all_tags($arraysubs_email_heading));
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";

printf(
    /* translators: %s: Customer first name. */
    esc_html__('Hi %s,', 'arraysubs'),
    esc_html($arraysubs_customer['first_name'])
);
echo "\n\n";

echo esc_html__('Your subscription renewal payment needs an extra verification step before it can be completed.', 'arraysubs') . "\n\n";
echo esc_html__('Subscription ID: ', 'arraysubs') . '#' . esc_html($arraysubs_subscription_id) . "\n";
echo esc_html__('Renewal Order: ', 'arraysubs') . '#' . esc_html($arraysubs_order_id) . "\n";
echo esc_html__('Payment amount: ', 'arraysubs') . esc_html($arraysubs_payment_amount) . "\n";

if (! empty($arraysubs_card_last4)) {
    printf(
        /* translators: 1: card brand, 2: last four digits. */
        esc_html__('Payment Method: %1$s ending in %2$s', 'arraysubs'),
        esc_html(ucfirst($arraysubs_card_brand ?: __('Card', 'arraysubs'))),
        esc_html($arraysubs_card_last4)
    );
    echo "\n";
}

echo esc_html__('Grace period: ', 'arraysubs') . esc_html($arraysubs_grace_period_ends_at) . "\n\n";
echo esc_html__('Complete verification:', 'arraysubs') . "\n";
echo esc_url($arraysubs_action_url) . "\n\n";
echo esc_html__('If verification is not completed, the renewal order will remain unpaid and the subscription will continue through the normal grace-period process.', 'arraysubs') . "\n\n";

if ($arraysubs_additional_content) {
    echo "----------\n\n";
    echo esc_html(wp_strip_all_tags(wptexturize($arraysubs_additional_content)));
    echo "\n\n";
}

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- WooCommerce core hook.
echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text')));
