From d7cb15c8f8b3339baccffe0e69c2fefce232c965 Mon Sep 17 00:00:00 2001 From: Gerhard Potgieter Date: Wed, 12 Sep 2018 11:30:53 +0200 Subject: [PATCH] Update email copy based on https://github.com/woocommerce/woocommerce/pull/21288#issuecomment-420251277 --- .../emails/class-wc-email-cancelled-order.php | 4 ++-- .../emails/class-wc-email-customer-invoice.php | 6 +++--- .../class-wc-email-customer-processing-order.php | 4 ++-- includes/emails/class-wc-email-failed-order.php | 2 +- includes/emails/class-wc-email-new-order.php | 4 ++-- templates/emails/admin-cancelled-order.php | 4 ++-- templates/emails/admin-failed-order.php | 4 ++-- templates/emails/admin-new-order.php | 4 ++-- templates/emails/customer-invoice.php | 4 ++-- templates/emails/customer-note.php | 4 ++-- templates/emails/customer-processing-order.php | 6 +++--- templates/emails/customer-reset-password.php | 11 +++++------ templates/emails/plain/admin-cancelled-order.php | 11 ++++++----- templates/emails/plain/admin-failed-order.php | 6 +++--- templates/emails/plain/admin-new-order.php | 10 +++++----- templates/emails/plain/customer-invoice.php | 4 ++-- templates/emails/plain/customer-note.php | 6 +++--- .../emails/plain/customer-processing-order.php | 10 +++++----- .../emails/plain/customer-reset-password.php | 15 +++++++-------- 19 files changed, 59 insertions(+), 60 deletions(-) diff --git a/includes/emails/class-wc-email-cancelled-order.php b/includes/emails/class-wc-email-cancelled-order.php index b38358d1745..06df5915cd2 100644 --- a/includes/emails/class-wc-email-cancelled-order.php +++ b/includes/emails/class-wc-email-cancelled-order.php @@ -57,7 +57,7 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) : * @return string */ public function get_default_subject() { - return __( '{site_title}: {order_billing_full_name} has cancelled order {order_number}', 'woocommerce' ); + return __( '[{site_title}]: {order_billing_full_name} has cancelled order #{order_number}', 'woocommerce' ); } /** @@ -67,7 +67,7 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) : * @return string */ public function get_default_heading() { - return __( 'Order Cancelled: {order_number}', 'woocommerce' ); + return __( 'Order Cancelled: #{order_number}', 'woocommerce' ); } /** diff --git a/includes/emails/class-wc-email-customer-invoice.php b/includes/emails/class-wc-email-customer-invoice.php index 8a3026d63fe..d6659c4f1bf 100644 --- a/includes/emails/class-wc-email-customer-invoice.php +++ b/includes/emails/class-wc-email-customer-invoice.php @@ -54,7 +54,7 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) : */ public function get_default_subject( $paid = false ) { if ( $paid ) { - return __( 'Invoice for order {order_number} on {site_title}', 'woocommerce' ); + return __( 'Invoice for order #{order_number} on {site_title}', 'woocommerce' ); } else { return __( 'Your latest {site_title} invoice', 'woocommerce' ); } @@ -69,9 +69,9 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) : */ public function get_default_heading( $paid = false ) { if ( $paid ) { - return __( 'Invoice for order {order_number}', 'woocommerce' ); + return __( 'Invoice for order #{order_number}', 'woocommerce' ); } else { - return __( 'Your invoice for order {order_number}', 'woocommerce' ); + return __( 'Your invoice for order #{order_number}', 'woocommerce' ); } } diff --git a/includes/emails/class-wc-email-customer-processing-order.php b/includes/emails/class-wc-email-customer-processing-order.php index 3cafbdcec13..011cc38abc3 100644 --- a/includes/emails/class-wc-email-customer-processing-order.php +++ b/includes/emails/class-wc-email-customer-processing-order.php @@ -56,7 +56,7 @@ if ( ! class_exists( 'WC_Email_Customer_Processing_Order', false ) ) : * @return string */ public function get_default_subject() { - return __( 'Your {site_title} order is now complete', 'woocommerce' ); + return __( 'Payment received for your order', 'woocommerce' ); } /** @@ -66,7 +66,7 @@ if ( ! class_exists( 'WC_Email_Customer_Processing_Order', false ) ) : * @return string */ public function get_default_heading() { - return __( 'Thanks for shopping with us', 'woocommerce' ); + return __( 'Thank you for your payment', 'woocommerce' ); } /** diff --git a/includes/emails/class-wc-email-failed-order.php b/includes/emails/class-wc-email-failed-order.php index 88df4fee6d0..4a85bc5e0fc 100644 --- a/includes/emails/class-wc-email-failed-order.php +++ b/includes/emails/class-wc-email-failed-order.php @@ -56,7 +56,7 @@ if ( ! class_exists( 'WC_Email_Failed_Order', false ) ) : * @return string */ public function get_default_subject() { - return __( '{site_title}: Order {order_number} has failed', 'woocommerce' ); + return __( '[{site_title}]: Order #{order_number} has failed', 'woocommerce' ); } /** diff --git a/includes/emails/class-wc-email-new-order.php b/includes/emails/class-wc-email-new-order.php index da5f0a1987a..b2bba5e9997 100644 --- a/includes/emails/class-wc-email-new-order.php +++ b/includes/emails/class-wc-email-new-order.php @@ -60,7 +60,7 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) : * @return string */ public function get_default_subject() { - return __( '{site_title} has a new order -- woo!', 'woocommerce' ); + return __( '[{site_title}]: New order #{order_number}', 'woocommerce' ); } /** @@ -70,7 +70,7 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) : * @return string */ public function get_default_heading() { - return __( 'New Order: {order_number}', 'woocommerce' ); + return __( 'New Order: #{order_number}', 'woocommerce' ); } /** diff --git a/templates/emails/admin-cancelled-order.php b/templates/emails/admin-cancelled-order.php index 62669b09b19..a447dc9ec05 100644 --- a/templates/emails/admin-cancelled-order.php +++ b/templates/emails/admin-cancelled-order.php @@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) { do_action( 'woocommerce_email_header', $email_heading, $email ); ?> -

get_formatted_billing_full_name(), $order->get_order_number() ); ?>

+

get_formatted_billing_full_name() ), esc_html( $order->get_order_number() ) ); ?>

-managing orders, or get tips for making your next sale.', 'woocommerce' ); // phpcs:ignore WordPress.XSS.EscapeOutput ?> +

-

get_order_number(), $order->get_formatted_billing_full_name() ); ?>

+

get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ); ?>

-troubleshooting failed payments.', 'woocommerce' ); // phpcs:ignore WordPress.XSS.EscapeOutput ?> +troubleshooting failed payments.', 'woocommerce' ); ?>

-

get_formatted_billing_full_name() ); ?>

+

get_formatted_billing_full_name() ); ?>

-

+

get_date_created() ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped + printf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) ); ?>

- +

-

get_billing_first_name() ); ?>

+

get_billing_first_name() ) ); ?>

@@ -54,7 +54,7 @@ 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 ); ?> -

+

-

get_billing_first_name() ); ?>

+

get_billing_first_name() ) ); ?>

-

get_order_number() ); ?>

+

get_order_number() ) ); ?>

- +

- +

-

- -

+ +

-

+

-

+

diff --git a/templates/emails/plain/admin-cancelled-order.php b/templates/emails/plain/admin-cancelled-order.php index 628afe1ab36..a4c5c022d4c 100644 --- a/templates/emails/plain/admin-cancelled-order.php +++ b/templates/emails/plain/admin-cancelled-order.php @@ -19,10 +19,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -echo '= ' . $email_heading . " =\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo '= ' . esc_html( $email_heading ) . " =\n\n"; /* translators: %1$s: Customer full name. %2$s: Order numer */ -echo printf( __( 'Alas. Just to let you know -- %1$s has cancelled order %2$s:', 'woocommerce' ), $order->get_formatted_billing_full_name(), $order->get_order_number() ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo sprintf( esc_html__( 'Alas. Just to let you know -- %1$s has cancelled order #%2$s:', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ), esc_html( $order->get_order_number() ) ) . "\n\n"; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; @@ -47,7 +47,8 @@ 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 ); -echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; -echo __( 'Read more about managing orders (https://docs.woocommerce.com/document/managing-orders/), or get tips for making your next sale (https://woocommerce.com/2018/03/10-ways-to-make-your-next-sale/)', 'woocommerce' ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo esc_html__( 'Thanks for reading.', 'woocommerce' ) . "\n\n"; -echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; + +echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); diff --git a/templates/emails/plain/admin-failed-order.php b/templates/emails/plain/admin-failed-order.php index 1d73574f8ae..84f9b6c6678 100644 --- a/templates/emails/plain/admin-failed-order.php +++ b/templates/emails/plain/admin-failed-order.php @@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) { echo '= ' . $email_heading . " =\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped /* translators: %1$s: Order number. %2$s: Customer full name. */ -echo printf( __( 'Oh dear! Payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' ), $order->get_order_number(), $order->get_formatted_billing_full_name() ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo sprintf( esc_html__( 'Payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n"; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; @@ -47,8 +47,8 @@ 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 ); -echo __( 'Hopefully they’ll be back. Read more about troubleshooting failed payments.', 'woocommerce' ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo esc_html__( 'Hopefully they’ll be back. Read more about troubleshooting failed payments.', 'woocommerce' ) . "\n\n"; echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; -echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); diff --git a/templates/emails/plain/admin-new-order.php b/templates/emails/plain/admin-new-order.php index eec41bb8efd..5624ba53425 100644 --- a/templates/emails/plain/admin-new-order.php +++ b/templates/emails/plain/admin-new-order.php @@ -19,10 +19,10 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -echo '= ' . $email_heading . " =\n\n"; // phpcs:ignore WordPress +echo '= ' . esc_html( $email_heading ) . " =\n\n"; /* translators: %s: Customer billing full name */ -echo sprintf( __( 'You’ve received the following order from %s.', 'woocommerce' ), $order->get_formatted_billing_full_name() ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo sprintf( esc_html__( 'You’ve received the following order from %s:', 'woocommerce' ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n"; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; @@ -47,8 +47,8 @@ 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 ); +echo esc_html__( 'Over to you.', 'woocommerce' ) . "\n\n"; + echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; -echo __( 'Woo! Over to you.', 'woocommerce' ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped - -echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); diff --git a/templates/emails/plain/customer-invoice.php b/templates/emails/plain/customer-invoice.php index 3499a19870c..890f364d2fb 100644 --- a/templates/emails/plain/customer-invoice.php +++ b/templates/emails/plain/customer-invoice.php @@ -72,8 +72,8 @@ 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 ); -echo esc_html__( 'Have a great day.', 'woocommerce' ) . "\n\n"; +echo esc_html__( 'Thanks for reading.', 'woocommerce' ) . "\n\n"; echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; -echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); +echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); diff --git a/templates/emails/plain/customer-note.php b/templates/emails/plain/customer-note.php index 56027020ed7..28d19c10491 100644 --- a/templates/emails/plain/customer-note.php +++ b/templates/emails/plain/customer-note.php @@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) { echo '= ' . esc_html( $email_heading ) . " =\n\n"; /* translators: %s Customer first name */ -printf( esc_html__( 'Hi %s,', 'woocommerce' ), $order->get_billing_first_name() ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; echo esc_html__( 'The following note has been added to your order:', 'woocommerce' ) . "\n\n"; echo "----------\n\n"; @@ -57,8 +57,8 @@ 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 ); -esc_html_e( 'Have a great day.', 'woocommerce' ); +echo esc_html__( 'Thanks for reading.', 'woocommerce' ) . "\n\n"; echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; -echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); diff --git a/templates/emails/plain/customer-processing-order.php b/templates/emails/plain/customer-processing-order.php index 0215808cd63..d32d663ee3f 100644 --- a/templates/emails/plain/customer-processing-order.php +++ b/templates/emails/plain/customer-processing-order.php @@ -19,12 +19,12 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -echo '= ' . $email_heading . " =\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo '= ' . esc_html( $email_heading ) . " =\n\n"; /* translators: %s: Customer first name */ -printf( __( 'Hi %s,', 'woocommerce' ), $order->get_billing_first_name() ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; /* translators: %s: Order number */ -printf( __( 'Just to let you know -- your payment has been confirmed, and order %s is now being processed:', 'woocommerce' ), $order->get_order_number() ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo sprintf( esc_html__( 'Just to let you know -- your payment has been confirmed, and order #%s is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) ) . "\n\n"; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; @@ -49,8 +49,8 @@ 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 ); -_e( 'Woo!', 'woocommerce' ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput +echo esc_html_e( 'Thanks!', 'woocommerce' ) . "\n\n"; echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; -echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); diff --git a/templates/emails/plain/customer-reset-password.php b/templates/emails/plain/customer-reset-password.php index 7fb61c54659..3c6df74c8be 100644 --- a/templates/emails/plain/customer-reset-password.php +++ b/templates/emails/plain/customer-reset-password.php @@ -21,17 +21,16 @@ if ( ! defined( 'ABSPATH' ) ) { echo '= ' . esc_html( $email_heading ) . " =\n\n"; -/* translators: %s Customer first name */ +/* translators: %s: Customer first name */ echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n"; -echo esc_html__( 'Someone (hopefully you) has requested a password reset for the following account on:', 'woocommerce' ) . "\n\n"; -/* translators: %s Store name */ -echo sprintf( esc_html__( 'Store: %s', 'woocommerce' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) . "\n\n";// phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -/* translators: %s Customer username */ +/* translators: %s: Store name */ +echo sprintf( esc_html__( 'Someone has requested a new password for the following account on %s:', 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ) . "\n\n"; +/* translators: %s: Customer username */ echo sprintf( esc_html__( 'Username: %s', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n"; -echo esc_html__( 'If this was a mistake, just ignore this email and nothing will happen. Otherwise, follow this link to reset your password now:', 'woocommerce' ) . "\n\n"; +echo esc_html__( 'If you didn\'t make this request, just ignore this email. If you\'d like to proceed:', 'woocommerce' ) . "\n\n"; echo esc_url( add_query_arg( array( 'key' => $reset_key, 'id' => $user_id ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ) . "\n\n"; // phpcs:ignore -echo esc_html__( 'Good luck!', 'woocommerce' ) . "\n\n"; +echo esc_html__( 'Thanks for reading.', 'woocommerce' ) . "\n\n"; echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; -echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) );// phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped +echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );