The Rule Builder widget enables you to define contextual rules for widgets based on weather, device, date/time and geolocation.
With this widget, you can set rules which follow a certain logic to perform an action such as displaying mobile-only content on mobile devices or hiding mobile content on a device which is not mobile. You can also use the rule builder to set contextual rules based on weather; for example, to set different messages to display for different temperature ranges.
A rule consists of two parts:
- The IF part, which sets the conditions that Open Time Content will look for.
- The THEN part, which dictates the actions that Open Time Content will take if these conditions are fulfilled.
Rules are processed in order, that is, Open Time Content will first try to match rule #1, then rule #2, and so on. The final rule is always the default rule if none of the conditions are fulfilled.
A rule builder widget must have at least one rule plus the default rule before you can use it.
Creating the Rule Builder widget
To create a Rule Builder widget, proceed as follows:
- In the Open Time Content page, navigate to the campaign you wish to add the widget to and open it, or create a new campaign.
- Click Create new Mailing and Tag and click the Rule Builder icon to open the wizard.
- Step 1: Give the mailing a name (we recommend to use the same name as the email campaign where you will add it) and click Next.
- Step 2: Give the rule a description and click Next to open the rule builder.
Defining basic rules
- Step 3: This is where you define the core rules for your Rule Builder widget. This has several steps depending on what you would like the rule to do.
- Remember that you can save your changes at any time and come back to the widget later. Also note that you can upload multiple images to use in separate rules, and that you can duplicate a rule for faster rule creation.
- To start, click Condition. The following conditions can be set:
||Day of Week
||UTC Datetime Parameter
||Average Temp °C
||Time of Day
||Min Temp °C
|Apparent Temp °C
||Operating System Family
||Day of Month
||Max Temp °C
|Apparent Temp °F
||Average Temp °F
|Wind Speed Km/h
||Min Temp °F
|Wind Speed Knots
||Max Temp °C
|Min Wind Speed Km/h
|Max Wind Speed Km/h
|Min Wind Speed Knots
|Max Wind Speed Knots
- Then select your operator. The available options will depend on the condition.
- Finally, select the value for the condition.
Combining multiple conditions
You can combine as many conditions as you like into the same rule. As you add conditions, use the visual formula builder to combine them using AND/OR and use the brackets to nest conditions within the rule.
- Use the controls in the toolbar to add more conditions, brackets and excluders (NOT).
- Drag and drop the elements in the formula to move them around.
- Switch between the AND/OR operators by clicking them.
- Some elements can be removed by clicking the small red cross in the upper right corner.
- If your formula is invalid, you will be notified by a red message. After you have corrected the error, the green message will inform you that the formula is now correct.
Defining actions for the rule
Once your conditions have been set, you must define the action that will be executed by Open Time Content. Proceed as follows:
- Click Edit Action to open the action editor.
You can now choose between using an image or a widget.
- Using an image - To display an image as the action, select Image and click Next. Upload an image from your computer and then enter the click-through URL. After you save the action will be shown in the rule.
- Using a widget - To display another Open Time Content widget as an action, select the widget type and click Next. You can now select from all the widgets of that type that you have already created.
The default rule
Once you have finished creating all your rules you must define the default rule that will apply if none of the conditions are fulfilled. The default rule is the only rule that cannot be deleted.
We recommend that the default action points to a generic image or widget.
Editing Rule Builder widgets
You can edit rules even if they are live in an email that has already been sent. For example, if you wish to change an image after the email has been sent, you can do this by updating the image in the rule builder.
To edit a Rule Builder widget, open the campaign that contains the widget, locate the rule you want to update and click the edit icons to make your changes. You can edit the conditions, their operators and values, and the actions.
All changes will automatically be pulled through into the email. The HTML tag will remain the same so once a tag has been added to the HTML, there is no need to make any changes to the email itself. Since this widget does not require a template you do not have to reselect this, as is the case for some of the other widgets.
Adding data parameters to a rule
Parameters allow you to add a data placeholder to the end of a tag that will take data from your contact database at the time of sending, and then combine with the context rule you have built. For example, you can merge M for male gender and F for female gender and then display the different images or widgets.
When you select String parameter from the condition selector, you have two options:
- Parameter name - The name of the parameter in the tag. This is for you to know what data is being merged. In this case, it is gender.
- Parameter value - The exact data merge command from your ESP. This is the value that tells the tag what to display. In this case, it is _M_or F.
Once you have selected those values, you can build your rule as usual.
Adding weather forecasts
You can select a weather forecast as the condition property if you are on the advanced package. This will allow you to show specific images or widgets based on the weather conditions that are forecast for a period of time after the recipient opens the email.