How to build dynamic content using CASE Statement (WHEN... THEN... ELSE)

CASE statement contains technical detail regarding the use of logical constructs to deploy content based on values found in application's database fields. The feature works very similarly to an IF...THEN statement.

Would you like to see different content supplied to email signatures, based on a logic decision, made behind the scenes? 


This is the CASE statement

With CASE statement, you create dynamic signature content, based on the value found in one field; 

{$$CASE(           )$$WHEN(                      )$$THEN(                      )$$ELSE(                      )$$} 

E.g. unique signature content based on country, company, department, etc.

{$$CASE(Department)$$WHEN(Service UK)$$THEN(IService department UK)$$ELSE(Service department)$$} 

The statement may create a great number of its descendants with minor changes or alter the whole signature’s overall appearance.

Whatever you want! It depends on what goals you are pursuing and the kind of varying emphasis you want to place on the standard signatures’ user base from different departments or companies etc. to attract the target clients.


How to create dynamic language sign off using only one template

Let's say that you would like to create different email signature sign off based on the country field. 

  • The United States = Best
  • The United Kingdom = Kind regards
  • Germany = Mit freundlichen Grüßen
  • Australia = Best regards
  • All other countries = --
{$$CASE(Country)$$WHEN(United States)$$THEN(Best)$$WHEN(United Kingdom)$$THEN(Kind regards)$$WHEN(Germany)$$THEN(Mit freundlichen Grüßen)$$WHEN(Australia)$$THEN(Best regards)$$ELSE(--)$$}


Detailed description

Compose your conditional statement using the template below:

{$$CASE(Field name)$$WHEN(Value to test)$$THEN(string to place in the signature if field value matched)$$ELSE(default string)$$}

P.S. There are curly brackets at the beginning and end of the statement and double dollar signs before each keyword. Parentheses after each keyword enclose the parameters:

CASE
field name to check
WHEN
value to test for (do not use quotes for the string to check for)
THEN
substitution string used if preceding "when" matches field value (do not use quotes for the string to insert)
ELSE
substitution string used if preceding "when" doesn’t match field value (do not use quotes for the string to insert)

While the system engine renders the signature, it compares the value of the field named in brackets, after the CASE keyword, to the strings in the brackets, which follow the WHEN keyword(s). 

If the field value matched one of the strings, then the sub-string in brackets following the THEN keyword is placed into the output. 

If none of the WHEN values match, the sub-string following the ELSE keyword is displayed.

Below example happens to show two possible values and a default to cover other values. Adding additional WHEN…THEN tests would allow you to test for additional String matches and provide additional customization.

The constants of THEN and ELSE strings may be styled via HTML or with a help of toolbar.

Place your conditional construct and use Preview to validate.

On the screenshot below you can see an example of field names which can be used. You could be driving intelligent content decisions off of any field.
Fields could be unique to City, State, Country, Department or any other stored value, that drives a differentiation in Marketing Message. 


Let's see this behavior in an example:

{$$CASE(Department)$$WHEN(IT)$$THEN(a modest geek’s signature)$$WHEN(Marketing)$$THEN(a flashy sales manager’s signature, <font color="red">highlighted in red</font>)$$ELSE(signature by default for other departments)$$}

Employee – Michelle Archambault; Department – IT:

Employee – Patty Adams; Department – Marketing:

Employee – Sue Anderson; Department – empty field:


We hope this functionality will come in handy to you!

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.