Recently I discovered AutomateWoo, which instantly became my favorite marketing automation plugin for WooCommerce.
I am also working much on improving renewal conversion rates for our plugins. I wanted to use AutomateWoo to send email to customers whose subscription got cancelled. I include a small discount coupon in these emails to give incentive to renew the plugin license.
I set up the workflow like this:
I was quite happy with it, however later I discovered that this workflow also fires for subscriptions which get cancelled by a refund. While WooCommerce orders distinguish cancelled and refunded status, WooCommerce Subscriptions does not. The subscription gets cancelled and there is no information if the parent order was cancelled or refunded.
It quite obvious that you do not want to send coupons to customers who you’ve just given a refund and they do not plan to use your products.
I wrote a ticket to AutomateWoo and they came with a solution, however it made me setup 2 workflows and tag users which orders were refunded. It was to complicated for such a basic feature.
So I dig in their docs and it turns out that you can create custom rules. Brilliant!
So I wanted a rule that would check the parent order of the cancelled subscription and only send the email if the order status is not refunded. You can find the complete code below.
Now my workflow looks like that:
Please also refer to the official AutomateWoo tutorial about custom rules to help you get started.