Skip to content

Conditional fields (Liquid templates)

This article uses the current Opensense template syntax, Liquid (as of 2022). If you’re used to the older format, see Conditional fields (legacy templates).

  • You can make any field a conditional field.
  • Make a field optional if some employees use it and some don’t. It’s removed automatically from the final email signature for employees who don’t use it.
  • You can wrap IF statements around any signature element, to make it appear only if that field is used: {% if field %} {{field}} {% endif %}.

HTML code view. The row is wrapped in an if statement:

A table row wrapped in {% if mobile %} and {% endif %}, so the M: label and the mobile link show only when the mobile field has a value

Recipient’s view. If either field is removed, the separator line is removed too.

Rendered signature lines on three rows: an office phone, a mobile number, and a website

HTML code view. Each field has its own if block, and a nested condition shows the separator only when both fields have values:

HTML code with separate if blocks for phone and mobile, and a nested condition that shows the separator only when both fields have values

Signature preview with logic:

One line of template logic: the phone, a nested phone-and-mobile check around the separator, then the mobile

Recipient’s view. If either field is removed, the separator line is removed too.

A rendered line with a phone number and a mobile number separated by a vertical bar

Need “not if” logic? We have that too. Wrap your HTML with {% unless field %} Alternative Text {% endunless %} instead.

For example: {% unless phone %} 1-800-MAINLINE {% endunless %}

For further help, contact Opensense Support at help@opensense.com.

Screenshot preview

Screenshot