The transforms described below are options available to a number of the text-based tokens, to manipulate the result before it is inserted into your email.
They are applied in the order supplied.
Tokens that accept transforms:
All alphabetic characters converted to lowercase
All alphabetic characters converted to uppercase
Uppercase the first character
Uppercase the first character of each word
Uppercase the first character of each word, and lowercase every other letter
This transform requires a value to be given:
Place the required number in place of x, for example:
Truncates text to x characters and appends ..., if the text is longer than x
This transform can optionally take a value, which is used as the format code. By default (ie. with no value provided) the format will be: d/m/Y
The examples below are based on the original value from a date field of 2010-04-05 10:30:15 :
dateformat => 14/5/2010 dateformat=Y-m-d => 2010-05-14 dateformat=Y-m-d H:i:s => 2010-05-14 10:30:15
This transform shows the difference between two dates, in number of days. It compares the value of the token with the optional value for the transform. If the transform value is omitted, the current date is used for the comparison. The result will always be a positive whole number.
Place the required comparison date in place of x in the format Y-m-d, for example:
The examples below are based on the original value from a date field of 2013-04-05 10:30:15 and a current date of 2013-04-01 :
datediff => 4 datediff=2013-04-26 => 21
Use a date modifier to produce a date, from date input in the token value.
Place the required modifier in place of x. The modifier accepts human-readable expressions.
The examples below are based on the original value from a date field of 2013-04-05 10:30:15 :
datemod=+1 day => 2013-04-06 10:30:15 datemod=-2 weeks => 2013-03-22 10:30:15 datemod=+3 months -6 hours => 2013-07-06 04:30:15
By default (ie. with no value provided) this transform will format a number to 2 decimal places, using a period (.) as the decimal separator, and a comma (,) as the thousand separator.
If is possible to alter the number of decimal places by specifying the number of decimal places required, to a maximum of 9, in place of x:
If a change to the decimal and thousand separators is also required, these can additionally be specified in place of d and t respectively:
The examples below are based on the original value from a number field of 12345.6789 :
numberformat => 12,345.68 numberformat=3 => 12,345.679 numberformat=3 . => 12.345 679 numberformat="3, " => 12 345,679
Note the use of a comma in the value requires the value to be wrapped in double-quotes.
Transforms a boolean value into alternate true/false values. By default a boolean field outputs 1 or 0.
The option value is specified as the new true and false outputs, separated by a colon. For example:
booleanformat=1:0 booleanformat=true:false booleanformat=yes:no
All characters which have HTML character entity equivalents are translated into these entities
Encodes and reserved characters for a URL
Prevents the use of
urlencode when combined with the
static option for the
Inserts HTML line breaks before all newlines
Strips HTML tags