Switch from "invoice" to "order details" in our emails. (#45395)

* Switch from "invoice" to "order details" in our emails.

* Revise default order details email subject text.

* Revise default order details header text.

* Bring E2E check up-to-date with latest text revision.

* Update API tests to match order detail email changes.

* Fix typo

---------

Co-authored-by: Jorge Torres <jorge.torres@automattic.com>
This commit is contained in:
Barry Hughes 2024-03-13 12:34:39 -07:00 committed by GitHub
parent 5933945127
commit 3f1dbd5b13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 18 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Prefer the use of 'order details' (instead of 'invoice') in our order emails.

View File

@ -199,7 +199,7 @@ class WC_Meta_Box_Order_Actions {
*/
private static function get_available_order_actions_for_order( $order ) {
$actions = array(
'send_order_details' => __( 'Email invoice / order details to customer', 'woocommerce' ),
'send_order_details' => __( 'Send order details to customer', 'woocommerce' ),
'send_order_details_admin' => __( 'Resend new order notification', 'woocommerce' ),
'regenerate_download_permissions' => __( 'Regenerate download permissions', 'woocommerce' ),
);

View File

@ -12,9 +12,11 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
/**
* Customer Invoice.
* Order details email.
*
* An email sent to the customer via admin.
* An email sent to the customer via admin, that summarizes the details of their order. This was
* historically referred to as the 'invoice', and for backwards compatibility reasons that is still
* reflected in the class name (although on a user-level we have moved away from that nomenclature).
*
* @class WC_Email_Customer_Invoice
* @version 3.5.0
@ -29,8 +31,8 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
public function __construct() {
$this->id = 'customer_invoice';
$this->customer_email = true;
$this->title = __( 'Customer invoice / Order details', 'woocommerce' );
$this->description = __( 'Customer invoice emails can be sent to customers containing their order information and payment links.', 'woocommerce' );
$this->title = __( 'Order details', 'woocommerce' );
$this->description = __( 'Order detail emails can be sent to customers containing their order information and payment links.', 'woocommerce' );
$this->template_html = 'emails/customer-invoice.php';
$this->template_plain = 'emails/plain/customer-invoice.php';
$this->placeholders = array(
@ -52,11 +54,7 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
* @return string
*/
public function get_default_subject( $paid = false ) {
if ( $paid ) {
return __( 'Invoice for order #{order_number} on {site_title}', 'woocommerce' );
} else {
return __( 'Your latest {site_title} invoice', 'woocommerce' );
}
return __( 'Details for order #{order_number} on {site_title}', 'woocommerce' );
}
/**
@ -67,11 +65,7 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :
* @return string
*/
public function get_default_heading( $paid = false ) {
if ( $paid ) {
return __( 'Invoice for order #{order_number}', 'woocommerce' );
} else {
return __( 'Your invoice for order #{order_number}', 'woocommerce' );
}
return __( 'Details for order #{order_number}', 'woocommerce' );
}
/**

View File

@ -225,9 +225,9 @@ test.describe.serial( 'Settings API tests: CRUD', () => {
expect.arrayContaining( [
expect.objectContaining( {
id: 'email_customer_invoice',
label: 'Customer invoice / Order details',
label: 'Order details',
description:
'Customer invoice emails can be sent to customers containing their order information and payment links.',
'Order detail emails can be sent to customers containing their order information and payment links.',
parent_id: 'email',
sub_groups: expect.arrayContaining( [] ),
} ),

View File

@ -237,7 +237,7 @@ test.describe( 'Merchant > Order Action emails received', () => {
.getByRole( 'row' )
.filter( { hasText: customerBilling.email } )
.filter( {
hasText: `Invoice for order #${ orderId } on ${ storeName }`,
hasText: `Details for order #${ orderId } on ${ storeName }`,
} )
).toBeVisible();
} );