Calculating and converting placeholders

In the article on personalization and placeholders in your emails we explained how you can use placeholders within your emails. You also have the option to do conversions and calculations within those placeholders. This allows you e.g. to display a saved date in a different format or to do calculations within number and date fields. Please note that the respective fields have the correct field type when you create them.

To use this functionality you must insert the placeholders directly into your email. Follow the following instructions to do calculations and conversions:


Converting date fields

To convert your custom date fields into another format (e.g. 01.01.2015) you need to do a so-called timestamp conversion. This will allow you to display the desired format:
{DATEFIELD[convert:timestamp][date:d.m.Y]}

Die This timestamp conversion is only necessary in your custom fields.

If e.g. you want to display system fields such as {CURRENT_DATE} the timestamp conversion is not required:
{CURRENT_DATE[date:d.m.Y]}


Calculations in date fields

Additionally you have the option to do calculations within date fields. Here the first step is also a timestamp conversion for custom date fields). After this you can do the calculations (addition or subtractions) within seconds. In this example we are adding 86,400 seconds (1 day):

{DATEFIELD[convert:timestamp][calc:+86400][date:d.m.Y]}

As mentioned above the timestamp calculation is not needed for calculations within system fields. If you want to do a calculation within a regular numeric field you can simply do the following:

{NUMERICFIELD[calc:+5]}


Display of numeric fields with delimiters

To display a saved large number with delimiters you can use the following functionality:

{NUMBER[num:2]}

The number 2 defines the decimal place of the displayed number. Of course you can also switch this to 0.


Important notes:

  1. Note the capital letters. The placeholders must always be entered in all caps and curly brackets!
  2. The actual function / calculation must always be entered in square brackets and without spaces.
  3. Check the selected functions closely with the CleverReach preview to make sure the results are accurate.
  4. Make sure that you use the correct placeholders. You will find an overview in the field overview.