<?php

/**
 * Customer new subscription email (plain text)
 *
 * @package ArraySubs\Features\Emails\templates\plain
 * @version 1.0.0
 */

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'] ?: __('there', 'arraysubs'))
);
echo "\n\n";

esc_html_e('Great news! Your subscription is now active. Here are the details:', 'arraysubs');
echo "\n\n";

echo "----------\n";
printf(
    /* translators: %s: Subscription ID */
    esc_html__('Subscription #%s', 'arraysubs'),
    esc_html($arraysubs_subscription_number)
);
echo "\n----------\n\n";

/* translators: %s: product name */
printf(esc_html__('Product: %s', 'arraysubs'), esc_html($arraysubs_product_name));
echo "\n";

printf(
    /* translators: 1: price, 2: billing period */
    esc_html__('Price: %1$s / %2$s', 'arraysubs'),
    esc_html(wp_strip_all_tags($arraysubs_recurring_amount)),
    esc_html($arraysubs_billing_period)
);
echo "\n";

printf(
    /* translators: %s: start date */
    esc_html__('Start Date: %s', 'arraysubs'),
    esc_html($arraysubs_start_date)
);
echo "\n";

printf(
    /* translators: %s: next payment date */
    esc_html__('Next Payment: %s', 'arraysubs'),
    esc_html($arraysubs_next_payment_date)
);
echo "\n\n";

printf(
    /* translators: %s: subscription management URL */
    esc_html__('View your subscription: %s', 'arraysubs'),
    esc_url($arraysubs_my_account_url)
);
echo "\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($arraysubs_email->format_string(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))));
