The CASE...WHEN...THEN...ELSE statement allows you to display different content in an email signature depending on the value of a field.
This is useful when you want one signature template to show different content for different users, such as departments, office locations, languages, or job roles.
Instead of creating multiple signature templates, you can build dynamic logic directly into the template.
When to use a CASE statement
Use a CASE statement when the content should change depending on the value of a field, not just whether the field is empty.
Typical examples include:
- Showing different phone numbers for different offices
- Displaying region-specific legal disclaimers
- Adding different marketing banners per department
- Changing language based on office location
CASE statement syntax
Use the following syntax:
{$$CASE(Field)$$
WHEN(Value1)$$THEN(Content for value1)$$
WHEN(Value2)$$THEN(Content for value2)$$
ELSE(Default content)$$}How it works:
- CASE(Field) → checks the value of the field
- WHEN(Value) → condition to match
- THEN → content shown when the condition matches
- ELSE → fallback content when no values match
Example 1 — Different phone numbers per office
If your company has multiple offices, you may want to display the correct phone number based on the employee’s office location.
Example statement:
{$$CASE(Office)$$
WHEN(New York)$$THEN(+1 212 555 1234)$$
WHEN(London)$$THEN(+44 20 7123 4567)$$
WHEN(Copenhagen)$$THEN(+45 33 12 45 67)$$
ELSE(+1 800 555 0000)$$}Result:
- Employees in London see the London number
- Employees in New York see the New York number
- Employees in other locations see the default number
Example 2 — Different marketing banners per department
You may want the Sales team to show a campaign banner while other employees show a general brand banner.
{$$CASE(Department)$$
WHEN(Sales)$$THEN(
)$$
WHEN(Marketing)$$THEN(
)$$
ELSE(
)$$}Result:
- Sales users show the sales campaign banner
- Marketing users show a marketing banner
- All other users see the standard company banner
Example 3 — Regional legal disclaimers
Legal requirements may differ between regions. A CASE statement allows you to automatically apply the correct disclaimer.
{$$CASE(Country)$$
WHEN(Germany)$$THEN(German legal disclaimer text)$$
WHEN(France)$$THEN(French legal disclaimer text)$$
WHEN(UK)$$THEN(UK legal disclaimer text)$$
ELSE(Standard global disclaimer)$$}Each user automatically receives the correct legal disclaimer depending on their country.
How to implement a CASE statement
- Go to Signatures in the Xink admin portal.
- Open the email signature you want to edit.
- Insert the CASE statement where the dynamic content should appear.
- Replace the field name and values with your own.
- Click Preview.
- Test with users from different departments or locations.
Tips for building CASE statements
- Make sure the values in WHEN() match the exact field values in your directory.
- Always include an ELSE condition to avoid empty results.
- Use Preview to test with multiple users before publishing.
CASE vs IFNULL vs NULL
These three statements are often used together when building dynamic templates:
- NULL → hides a field if it is empty
- IFNULL → shows alternative content if a field is empty
- CASE → changes content depending on the field value
Using these together allows you to build highly flexible email signature templates.
