Insert-if sections: How to create, edit, and remove conditions

In Shared Email Templates

You can set a condition for a paragraph, a list, a list item, a table, or a table row and get this section inserted into an email message along with the whole template only when the condition is met.

How to add a condition

To set a condition, start editing your template, right-click the section you want to set a condition for—a paragraph, a list, a list item, a table, or a table row—and then select Add condition:
The Add condition option

The Add condition dialog will appear. Use it to formulate your condition. First, decide whether you want to base your condition on some text in an email message field or on the result returned by the ~%WhatToEnter macro, and then select the corresponding option: Message field or WhatToEnter result.

  • With the Message field option selected under Find in, you need to:
    • Choose a field that will be checked for your condition: body, from, to, cc, bcc, subject, location, recipient's or sender's first, last, or full name.
    • Select the condition itself: "contains", "doesn't contain", "is equal to", "matches", or "doesn't match".
    • Enter the text or regular expression that the add-in will look for when checking whether your condition is met.

      Note. Such conditions as "matches" and "doesn't match" require a regular expression.

    Formulate your condition.

  • With the WhatToEnter result option selected under Find in, you need to:
    • Choose a ~%WhatToEnter macro that will be checked for your condition. There must be at least one ~%WhatToEnter macro with the Text field, Dropdown list, or Dataset option in your template. The Date and Time options of the ~%WhatToEnter macro are not supported.
    • Select the condition itself: "contains", "doesn't contain", "is equal to", "matches", or "doesn't match".
    • Enter the text or regular expression that the add-in will look for when checking whether your condition is met.

      Note. Such conditions as "matches" and "doesn't match" require a regular expression.

    Formulate your condition.

Tip. To avoid inserting the result brought by the ~%WhatToEnter macro into an email message along with the whole template and use that result to simply check your condition, select the For Insert-if sections only checkbox when inserting the ~%WhatToEnter macro into your template:
Condition validation only

When you're done, click OK.

The section that your condition is applied to will be marked with a green indicator:
A green indicator in a template

Note. If you set a condition for a list item, you won't be able to set a condition for the whole list, and vice versa. If you set a condition for a table row, you won't be able to set a condition for the whole table, and vice versa.

Note. If you copy a paragraph from another source and paste it into your template, <p> tags might be missing there and it won't be possible to set a condition for such a paragraph.

How to edit a condition

If you want to modify a condition, right-click the section it's applied to and opt for Change condition:
The Change condition option

After you make the necessary changes, click Save.

How to remove a condition

In the editing mode, right-click the section where the condition is not needed and select the Remove condition option:
The Remove condition option

Then click Save.

Post a comment

Seen by everyone, do not publish license keys and sensitive personal info!

If you have any questions or issues with this add-in, please feel free to post your concerns in the comments area. As soon as we answer, a notification message will be sent to your e-mail. If you do not want to share your thoughts in public, please contact us at support@ablebits.com.