How it works
The basic idea behind conseqs is very simple - do something when something happens in your store. If you are familiar with IFTTT or Zapier, you will probably recognise the concept. The only difference is that this module works inside your store.
This module can connect different modules or functionality together even if they weren't designed to work that way. For example, you can give your customer a voucher as a thank you for creating a review. You can do this by creating automation rule. Every rule consist of of three parts: trigger, conditions, and action. Let's look into them closely
Trigger section describe the event that will start the whole automation process. There are many different triggers you can choose from. For example, there is one called Stock quantity changed that is executed when product quantity changes, either by selling product or by editing product in your back office. Or another one named review has been approved that is executed when employee approves review.
When trigger is executed it collects some informations and provide them to the conditions and action layer. The gathered information is different for each trigger. For example, trigger Stock quantity changed will provide information about old quantity, new quantity, and also information about affected product (including its ID, reference, and name)
Beside these trigger-specific information, action will have access to context variables. These are mainly static information about your system (shop name, shop url), but also dynamic parameters like current url, date and time, logged in customer, or visitor's currency.
You can use all these information in the next sections to do what you need.
Optional condition section allows you to react only on some events. For example, for Stock quantity changed trigger, you can create condition new quantity < 10 and old quantity >= 10. This will make sure that action will be executed only when product quantity drops down below 10.
You can create as many conditions as you need, and use any information provided by trigger. This will allow you to create very specific automation rules.
The last section describes what will happen when trigger is executed and all conditions are met. You can choose from many different actions. For example, you can send email, log information to text file, or create voucher.
Every action needs different parameters - for send email action it might be email address, for create voucher it is customer ID and voucher amount, etc. We need to somehow provide these parameters to actions. There are three ways to that
- constant -- you can simply enter constant value, for example you can enter your own email address
- bind value -- you can use one of the parameter provided by trigger
- interpolate values -- this allow you to combine above two approaches, and substitute multiple parameters into constant text