I need to add a new event to rules triggered by the successful completion of an order. The action is to grant a user a role which will expire in a fixed duration.
I've tried following the Rules documentation and adding a module with a *.rules.events.yml file. But modifying it to use the order_complete
event which I got from this tutorial.
Unfortunately, even though it DID add an option to the events drop down, it doesn't trigger an action.
I've tried a grep
through the commerce code for order_complete
but it doesn't yield anything.
The action I've set to the rule is just to print a message.
order_complete
event. That is just the name of your custom event listener service (it could be anything). It listens to thecommerce_order.place.post_transition
event.commerce_order.place.post_transition
worked!