Commit a2b0e83c607 for woocommerce
commit a2b0e83c607e940dc207b0b16d9fe25edc114838
Author: Allison Levine <1689238+allilevine@users.noreply.github.com>
Date: Fri Feb 27 09:52:55 2026 -0500
Fix customer note email preview text and newline support (#63459)
* Fix customer note email preview text and newline rendering
Use admin→customer note text for the Customer Note Added email preview
instead of the shopper→admin checkout note. Also wrap the admin order
note personalization tag output with nl2br() so multi-line notes render
with proper line breaks in the block email.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add changelog entry for customer note email fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
diff --git a/plugins/woocommerce/changelog/stomail-7827-fix-customer-note-email-preview-and-newlines b/plugins/woocommerce/changelog/stomail-7827-fix-customer-note-email-preview-and-newlines
new file mode 100644
index 00000000000..c50db5f0b4c
--- /dev/null
+++ b/plugins/woocommerce/changelog/stomail-7827-fix-customer-note-email-preview-and-newlines
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fix customer note email preview using wrong note text and missing newline support in admin order note personalization tag.
diff --git a/plugins/woocommerce/src/Internal/Admin/EmailPreview/EmailPreview.php b/plugins/woocommerce/src/Internal/Admin/EmailPreview/EmailPreview.php
index e1e2ece2b64..9b7f917ad23 100644
--- a/plugins/woocommerce/src/Internal/Admin/EmailPreview/EmailPreview.php
+++ b/plugins/woocommerce/src/Internal/Admin/EmailPreview/EmailPreview.php
@@ -216,7 +216,7 @@ class EmailPreview {
} else {
$object = $this->get_dummy_order();
if ( 'WC_Email_Customer_Note' === $email_type ) {
- $this->email->customer_note = $object->get_customer_note();
+ $this->email->customer_note = __( "This is an order note sent from the Admin to the customer during fulfillment when you add a new Order Note and choose to send it to the customer.\n\nIt can be multiple lines.", 'woocommerce' );
}
if ( 'WC_Email_Customer_Refunded_Order' === $email_type ) {
$this->email->partial_refund = false;
diff --git a/plugins/woocommerce/src/Internal/EmailEditor/PersonalizationTags/StoreTagsProvider.php b/plugins/woocommerce/src/Internal/EmailEditor/PersonalizationTags/StoreTagsProvider.php
index 41a2cd5c544..21b978c5af3 100644
--- a/plugins/woocommerce/src/Internal/EmailEditor/PersonalizationTags/StoreTagsProvider.php
+++ b/plugins/woocommerce/src/Internal/EmailEditor/PersonalizationTags/StoreTagsProvider.php
@@ -105,7 +105,7 @@ class StoreTagsProvider extends AbstractTagProvider {
__( 'Store', 'woocommerce' ),
function ( array $context ): string {
if ( isset( $context['wc_email'], $context['wc_email']->customer_note ) ) {
- return wptexturize( $context['wc_email']->customer_note );
+ return nl2br( wptexturize( $context['wc_email']->customer_note ) );
}
return '';
},