Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 20
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * CSV Export Email Template (Plain Text)
4 *
5 * This template can be overridden by copying it to yourtheme/woocommerce/csv-export-email-plain.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
23echo '= ' . esc_html( $email_heading ) . " =\n\n";
24
25esc_html_e( 'Your CSV export is attached to this email.', 'jetpack-premium-analytics-pkg' );
26echo "\n\n";
27
28echo esc_html( $report_label ) . "\n\n";
29
30echo esc_html__( 'Date Range:', 'jetpack-premium-analytics-pkg' ) . ' ';
31$from = empty( $params['from'] ) ? '' : gmdate( 'F j, Y', (int) strtotime( $params['from'] ) );
32$to   = empty( $params['to'] ) ? '' : gmdate( 'F j, Y', (int) strtotime( $params['to'] ) );
33/* translators: 1: Start date, 2: End date */
34echo esc_html( sprintf( __( '%1$s to %2$s', 'jetpack-premium-analytics-pkg' ), $from, $to ) );
35echo "\n\n";
36
37if ( $is_comparison ) {
38    echo esc_html__( 'Comparison Period:', 'jetpack-premium-analytics-pkg' ) . ' ';
39    $compare_from = empty( $params['compare_from'] ) ? '' : gmdate( 'F j, Y', (int) strtotime( $params['compare_from'] ) );
40    $compare_to   = empty( $params['compare_to'] ) ? '' : gmdate( 'F j, Y', (int) strtotime( $params['compare_to'] ) );
41    /* translators: 1: Start date, 2: End date */
42    echo esc_html( sprintf( __( '%1$s to %2$s', 'jetpack-premium-analytics-pkg' ), $compare_from, $compare_to ) );
43    echo "\n\n";
44}
45
46esc_html_e( 'The report is attached as a CSV file.', 'jetpack-premium-analytics-pkg' );
47echo "\n\n";
48
49echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
50
51/**
52 * Output email footer text.
53 *
54 * @hooked woocommerce_email_footer_text filter for footer text
55 */
56echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );