Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 19
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * CSV Export Email Template (HTML)
4 *
5 * This template can be overridden by copying it to yourtheme/woocommerce/csv-export-email.php.
6 *
7 * @package Automattic\Jetpack\PremiumAnalytics\Reports\Export
8 *
9 * @var WC_Email $email         Email object.
10 * @var string   $report_label  Report label.
11 * @var array    $params        Report parameters.
12 * @var string   $email_heading Email heading.
13 * @var bool     $sent_to_admin Whether sent to admin.
14 * @var bool     $is_comparison Whether this is a comparison request.
15 *
16 * @phan-file-suppress PhanUndeclaredGlobalVariable -- Template variables are provided by wc_get_template_html() via extract(); see the @var block above.
17 */
18
19defined( 'ABSPATH' ) || exit;
20
21// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- Template variables are provided by wc_get_template_html() via extract(); see the @var block above.
22
23/**
24 * Output the email header.
25 *
26 * @hooked WC_Emails::email_header() Output the email header
27 */
28do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
29
30<p><?php esc_html_e( 'Your CSV export is attached to this email.', 'jetpack-premium-analytics-pkg' ); ?></p>
31
32<h2><?php echo esc_html( $report_label ); ?></h2>
33
34<p>
35    <strong><?php esc_html_e( 'Date Range:', 'jetpack-premium-analytics-pkg' ); ?></strong>
36    <?php
37    $from = empty( $params['from'] ) ? '' : gmdate( 'F j, Y', (int) strtotime( $params['from'] ) );
38    $to   = empty( $params['to'] ) ? '' : gmdate( 'F j, Y', (int) strtotime( $params['to'] ) );
39    /* translators: 1: Start date, 2: End date */
40    echo esc_html( sprintf( __( '%1$s to %2$s', 'jetpack-premium-analytics-pkg' ), $from, $to ) );
41    ?>
42</p>
43
44<?php if ( $is_comparison ) : ?>
45    <p>
46        <strong><?php esc_html_e( 'Comparison Period:', 'jetpack-premium-analytics-pkg' ); ?></strong>
47        <?php
48        $compare_from = empty( $params['compare_from'] ) ? '' : gmdate( 'F j, Y', (int) strtotime( $params['compare_from'] ) );
49        $compare_to   = empty( $params['compare_to'] ) ? '' : gmdate( 'F j, Y', (int) strtotime( $params['compare_to'] ) );
50        /* translators: 1: Start date, 2: End date */
51        echo esc_html( sprintf( __( '%1$s to %2$s', 'jetpack-premium-analytics-pkg' ), $compare_from, $compare_to ) );
52        ?>
53    </p>
54<?php endif; ?>
55
56<p><?php esc_html_e( 'The report is attached as a CSV file.', 'jetpack-premium-analytics-pkg' ); ?></p>
57
58<?php
59/**
60 * Output the email footer.
61 *
62 * @hooked WC_Emails::email_footer() Output the email footer
63 */
64do_action( 'woocommerce_email_footer', $email );