Skip to content

Commit

Permalink
Avoid resending Processing Order customer email when merchant wins di…
Browse files Browse the repository at this point in the history
…spute (#3674)

* Skip 'Processing Order' customer email on merchant dispute win

* Add changelog and readme entries

---------

Co-authored-by: Wesley Rosa <[email protected]>
  • Loading branch information
annemirasol and wjrosa authored Dec 23, 2024
1 parent b1421eb commit ddcceba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Changelog ***

= 9.1.0 - xxxx-xx-xx =
* Tweak - Avoid re-sending Processing Order customer email when merchant wins dispute.
* Fix - Allow the saving of iDEAL tokens when SEPA is disabled.
* Fix - Fixes the incompatibility notice in editor due missing style property when instantiating Stripe payment methods.
* Dev - Updates the GitHub caching action (`actions/cache`) to v4 due deprecation.
Expand Down
13 changes: 13 additions & 0 deletions includes/class-wc-stripe-webhook-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 - Allow the saving of iDEAL tokens when SEPA is disabled.
* Fix - Fixes the incompatibility notice in editor due missing style property when instantiating Stripe payment methods.
* Dev - Updates the GitHub caching action (`actions/cache`) to v4 due deprecation.
Expand Down

0 comments on commit ddcceba

Please sign in to comment.