Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,4 @@
Significance: patch
Type: tweak

Prefer the use of 'order details' (instead of 'invoice') in our order emails.
Expand Up @@ -199,7 +199,7 @@ public static function set_email_sent_message( $location ) {
*/
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' ),
);
Expand Down
Expand Up @@ -12,9 +12,11 @@
if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) :

/**
* Customer Invoice.
* OOrder 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
Expand All @@ -29,8 +31,8 @@ class WC_Email_Customer_Invoice extends WC_Email {
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(
Expand All @@ -52,11 +54,7 @@ public function __construct() {
* @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 __( 'Order #{order_number} from {site_title}', 'woocommerce' );
barryhughes marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand All @@ -67,11 +65,7 @@ public function get_default_subject( $paid = 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 __( 'Order #{order_number}', 'woocommerce' );
barryhughes marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
Expand Up @@ -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: `Order #${ orderId } from ${ storeName }`,
barryhughes marked this conversation as resolved.
Show resolved Hide resolved
} )
).toBeVisible();
} );
Expand Down