I want to trigger an API request to Klavyos plugin whenever order status changes from pending payment to cancelled
I’m using the Klavyo plugin to create flows and send emails to customers in case of abandoned carts and cancelled orders. Abandoned carts are a common issue so they are provided by default by the plugin.
But regarding cancelled orders, I want to send an API request to Klavyo whenever the order status changes from pending payment to cancelled.
How can woocommerce_order_status_changed hook know if the previous status was pending payment?