From f41070f91eb1858381d574a575ad977e61403417 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 4 Mar 2019 17:04:58 +0000 Subject: [PATCH] Add content to html emails --- templates/emails/admin-cancelled-order.php | 7 +++++++ templates/emails/admin-failed-order.php | 14 ++++++++------ templates/emails/admin-new-order.php | 11 +++++++++-- templates/emails/customer-completed-order.php | 13 +++++++------ templates/emails/customer-invoice.php | 13 ++++++++++--- templates/emails/customer-new-account.php | 2 +- templates/emails/customer-note.php | 9 ++++++++- templates/emails/customer-on-hold-order.php | 17 +++++++++-------- templates/emails/customer-processing-order.php | 13 +++++++------ templates/emails/customer-refunded-order.php | 15 ++++++++------- templates/emails/customer-reset-password.php | 10 +++++++++- 11 files changed, 83 insertions(+), 41 deletions(-) diff --git a/templates/emails/admin-cancelled-order.php b/templates/emails/admin-cancelled-order.php index aeeada9e8a1..14b0e416514 100644 --- a/templates/emails/admin-cancelled-order.php +++ b/templates/emails/admin-cancelled-order.php @@ -48,6 +48,13 @@ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); +/** + * Show user-defined additonal content - this is set in each email's settings. + */ +if ( $additional_content ) { + echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); +} + /* * @hooked WC_Emails::email_footer() Output the email footer */ diff --git a/templates/emails/admin-failed-order.php b/templates/emails/admin-failed-order.php index 5c96812aa88..33c6bb13e29 100644 --- a/templates/emails/admin-failed-order.php +++ b/templates/emails/admin-failed-order.php @@ -12,7 +12,7 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce/Templates/Emails - * @version 3.5.0 + * @version 3.6.0 */ if ( ! defined( 'ABSPATH' ) ) { @@ -47,11 +47,13 @@ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); -?> -

-troubleshooting failed payments.', 'woocommerce' ) ); ?> -

- -

get_formatted_billing_full_name() ); ?>

+

get_formatted_billing_full_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

-

- -

-

get_date_created() ) ) ); + /* translators: %s Order date */ + printf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) ); ?>

-

-

' . esc_html( $user_login ) . '', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); ?>

+

' . esc_html( $user_login ) . '', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

diff --git a/templates/emails/customer-note.php b/templates/emails/customer-note.php index ccf34ba9f9f..108fe31eeb5 100644 --- a/templates/emails/customer-note.php +++ b/templates/emails/customer-note.php @@ -28,7 +28,7 @@ do_action( 'woocommerce_email_header', $email_heading, $email ); ?>

get_billing_first_name() ) ); ?>

-
+

@@ -53,6 +53,13 @@ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); +/** + * Show user-defined additonal content - this is set in each email's settings. + */ +if ( $additional_content ) { + echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); +} + /* * @hooked WC_Emails::email_footer() Output the email footer */ diff --git a/templates/emails/customer-on-hold-order.php b/templates/emails/customer-on-hold-order.php index 29dcae20f9c..ad573053e7b 100644 --- a/templates/emails/customer-on-hold-order.php +++ b/templates/emails/customer-on-hold-order.php @@ -12,7 +12,7 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce/Templates/Emails - * @version 3.5.0 + * @version 3.6.0 */ if ( ! defined( 'ABSPATH' ) ) { @@ -25,8 +25,8 @@ if ( ! defined( 'ABSPATH' ) ) { do_action( 'woocommerce_email_header', $email_heading, $email ); ?> -

get_billing_first_name() ); ?>

-

+

get_billing_first_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

+

-

- -

- -

- -

- -

get_billing_first_name() ); ?>

+

get_billing_first_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

-

- -

-

- +