Grouping of conditions

Besides defining single conditions in rules, the administrator of the program can also group multiple Conditions and create logical And/Or relationships between them in the same way as in the case of bare conditions. Thanks to this solution, any clause of grouped conditions can work as a separate unit from the other conditions defined within a single rule.

Please note that in the case of grouped conditions, a particular And/Or relationship type always applies to the whole group defined above it, e.g. in the following example And applies to the group of both Sender fields instead of only the second Sender (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 ER Pro 2.x - conditions grouping button button (Fig. 2.).

Fig. 2. Grouping of conditions.

On the other hand, to remove the grouping brackets from selected conditions, mark them and use the ER Pro 2.x - remove conditions grouping icon button.

By skillfully using conditions and groupings, you have practically unlimited possibilities of defining conditions for rules.

Please note that you may use grouping brackets to nest the groups of conditions within one another (Fig. 3.).

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 us assume that we want to add a promotional 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 first two 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 exactly what we wanted. According to the order of executing logical conditions, our expression will be true if the "Newsletter" phrase is found in the subject independently from the other three defined conditions. To better understand this, the order of execution in this case can be described by using brackets:

(Sender belongs to the Marketing Group And the Recipient is external And the subject of a message contains phrase "Offer")
Or (the subject of a 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 a message contains phrase "Offer" Or the subject of a message contains phrase "Newsletter")

We can achieve such an outcome by grouping the conditions with brackets:

Fig. 6. Grouping of 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 the messages sent by the Marketing department to:

  1. External email addresses if the subject of a message contains "Offer" or "Newsletter" phrase.
  2. Employees (Internal email addresses) if the subject contains the phrase "Promo".

    if the sent mail contains at least one attachment.

Finally, our redesigned expression will look like this:

Fig. 7. Adding additional grouping brackets to conditions.

See next

Sender - this article describes how to configure the Sender condition.

Was this information useful?