<?php

/**
 * Admin new subscription email
 *
 * @package ArraySubs\Features\Emails\templates
 * @version 1.0.0
 */

defined('ABSPATH') || exit;

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- WooCommerce core hook
do_action('woocommerce_email_header', $arraysubs_email_heading, $arraysubs_email);
?>

<p>
<?php
    printf(
        /* translators: %1$s: customer name, %2$s: subscription ID */
        esc_html__('You have received a new subscription from %1$s. Subscription #%2$s details are shown below.', 'arraysubs'),
        esc_html($arraysubs_customer['full_name'] ?: $arraysubs_customer['email']),
        esc_html($arraysubs_subscription_number)
    );
    ?>
    </p>

<h2>
<?php
    printf(
        /* translators: %s: Subscription ID */
        esc_html__('Subscription #%s', 'arraysubs'),
        esc_html($arraysubs_subscription_number)
    );
    ?>
    </h2>

<table class="td" cellspacing="0" cellpadding="6" style="width: 100%; margin-bottom: 40px;" border="1">
    <tbody>
        <tr>
            <th class="td" scope="row" style="text-align: left;"><?php esc_html_e('Customer', 'arraysubs'); ?></th>
            <td class="td" style="text-align: left;">
                <?php echo esc_html($arraysubs_customer['full_name']); ?>
                (<?php echo esc_html($arraysubs_customer['email']); ?>)
            </td>
        </tr>
        <tr>
            <th class="td" scope="row" style="text-align: left;"><?php esc_html_e('Product', 'arraysubs'); ?></th>
            <td class="td" style="text-align: left;">
                <?php echo esc_html($arraysubs_product_name); ?>
            </td>
        </tr>
        <tr>
            <th class="td" scope="row" style="text-align: left;"><?php esc_html_e('Recurring Amount', 'arraysubs'); ?></th>
            <td class="td" style="text-align: left;">
                <?php echo wp_kses_post($arraysubs_recurring_amount); ?>
                /
                <?php echo esc_html($arraysubs_billing_period); ?>
            </td>
        </tr>
        <tr>
            <th class="td" scope="row" style="text-align: left;"><?php esc_html_e('Start Date', 'arraysubs'); ?></th>
            <td class="td" style="text-align: left;">
                <?php echo esc_html($arraysubs_start_date); ?>
            </td>
        </tr>
        <tr>
            <th class="td" scope="row" style="text-align: left;"><?php esc_html_e('Next Payment', 'arraysubs'); ?></th>
            <td class="td" style="text-align: left;">
                <?php echo esc_html($arraysubs_next_payment_date); ?>
            </td>
        </tr>
        <tr>
            <th class="td" scope="row" style="text-align: left;"><?php esc_html_e('Payment Method', 'arraysubs'); ?></th>
            <td class="td" style="text-align: left;">
                <?php echo esc_html($arraysubs_payment_method_title); ?>
            </td>
        </tr>
    </tbody>
</table>

<p>
    <a class="link" href="<?php echo esc_url(admin_url('admin.php?page=arraysubs-mainadmin#/subscriptions/detail/' . $arraysubs_subscription_number)); ?>">
        <?php esc_html_e('View Subscription', 'arraysubs'); ?>
    </a>
</p>

<?php
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- WooCommerce core hook
do_action('woocommerce_email_footer', $arraysubs_email);
