From 9f0512e4dbe9aa0055847caa329644576ca70b93 Mon Sep 17 00:00:00 2001 From: Anne Mirasol Date: Fri, 20 Dec 2024 14:45:16 -0600 Subject: [PATCH 1/2] Skip 'Processing Order' customer email on merchant dispute win --- includes/class-wc-stripe-webhook-handler.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/class-wc-stripe-webhook-handler.php b/includes/class-wc-stripe-webhook-handler.php index 964bfd8ea..572903a36 100644 --- a/includes/class-wc-stripe-webhook-handler.php +++ b/includes/class-wc-stripe-webhook-handler.php @@ -400,6 +400,19 @@ public function process_webhook_dispute_closed( $notification ) { // Fail order if dispute is lost, or else revert to pre-dispute status. $order_status = 'lost' === $status ? 'failed' : $this->get_stripe_order_status_before_hold( $order ); + + // Do not re-send "Processing Order" email to customer after a dispute win. + if ( 'processing' === $order_status ) { + $emails = WC()->mailer()->get_emails(); + if ( isset( $emails['WC_Email_Customer_Processing_Order'] ) ) { + $callback = [ $emails['WC_Email_Customer_Processing_Order'], 'trigger' ]; + remove_action( + 'woocommerce_order_status_on-hold_to_processing_notification', + $callback + ); + } + } + $order->update_status( $order_status, $message ); } else { $order->add_order_note( $message ); From 8fd057650ffe3ab32383a52b5b02c0ebeda8794f Mon Sep 17 00:00:00 2001 From: Anne Mirasol Date: Fri, 20 Dec 2024 16:08:47 -0600 Subject: [PATCH 2/2] Add changelog and readme entries --- changelog.txt | 1 + readme.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/changelog.txt b/changelog.txt index 5b4dba676..c45e5207e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,7 @@ *** Changelog *** = 9.1.0 - xxxx-xx-xx = +* Tweak - Avoid re-sending Processing Order customer email when merchant wins dispute. * Fix - Don't update canceled order status to on-hold when a dispute is opened. * Fix - Correctly sets the dispute opened note when a dispute does not require any further action. * Add - Display Multibanco payment instruction details in Order Received page and Order Confirmation email. diff --git a/readme.txt b/readme.txt index 9c7c32b23..9d5855099 100644 --- a/readme.txt +++ b/readme.txt @@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o == Changelog == = 9.1.0 - xxxx-xx-xx = +* Tweak - Avoid re-sending Processing Order customer email when merchant wins dispute. * Fix - Don't update canceled order status to on-hold when a dispute is opened. * Fix - Correctly sets the dispute opened note when a dispute does not require any further action. * Add - Display Multibanco payment instruction details in Order Received page and Order Confirmation email.