Besides defining individual conditions in rules, the Administrator of the program can also group the chosen Conditions and create the logical And / Or relationship between them, in the same way, as in the case of bare conditions. Owing to this solution, any clause of grouped conditions can work as a separate unit from other conditions defined within a single rule.
Please note that the particular And / Or relationship type in the case of grouped conditions always applies to the whole group defined above it, e.g. in the following example And applies to the group of both Sender fields and not just the first one from the bottom (Fig. 1.).
|Fig. 1. Conditions with grouping brackets.|
The logical relationship between the defined groups of conditions is shown at the bottom of the window in the status area and explains how the conditions will be executed.
To group the conditions, mark the ones you want to group and hit the button (Fig. 2.).
|Fig. 2. Grouping conditions.|
On the other hand, to remove the grouping brackets from selected conditions, mark them and use the button.
By skillfully using conditions and grouping, you may define practically endless ways to define conditions for rules.
Please note that you may use grouping brackets to nest the groups of conditions within one another (Fig. 3.). Although such a possibility exists, we recommend staying open minded while grouping and nesting the groups of conditions.
|Fig. 3. Nested groups of conditions.|
Example of usage
To get a better understanding of the grouping feature, please take a look at the example below.
Let's assume that we want to add a promo footer to messages sent from the Marketing Department to all external email addresses:
|Fig. 4. Two conditions added.|
To make the expression more complex we decide that the footer will be added only if the two first conditions from the top (Sender and Recipient) are true and the subject of a message contains phrases: "Offer" or "Newsletter".
|Fig. 5. Adding additional conditions.|
However, the outcome of such a composition is not what we've meant. According to the order of executing logical conditions, our expression will be true if the "Newsletter" phrase is found in the subject independently from other defined conditions. Let's see the order of execution by using brackets:
(Sender belongs to the Marketing Group, And the Recipient is external And the subject of the message contains phrase "Offer")
Or (the subject of the message contains phrase "Newsletter")
The expression we wanted to have was:
(Sender belongs to the Marketing Group And the Recipient is external)
And (the subject of the message contains phrase "Offer", Or the subject of the message contains phrase "Newsletter")
We can achieve such outcome by grouping the conditions with brackets:
|Fig. 6. Grouping conditions.|
As we can nest the conditions within one another, we can make another step forward with our expression. We will redefine the conditions to add a promo footer to messages sent by the Marketing Department to:
- External email addresses if the subject of the message contains "Offer" or "Newsletter" phrase.
- Employees (Internal email addresses) if the subject contains the phrase "Promo".
Finally, our redesigned expression will look like this:
|Fig. 7. Adding additional grouping brackets to conditions.|