Customize messages


You can insert ″dynamic text″ (also called a ″dynamic field″) to customize the message. For example, you can start your message with a ″Dear …,″ personalized with the first name of each user. Or you can customize some parts of the message by including contents from external sources.


Know and be able to use dynamic codes to customize any part of the message.

Supported codes

Here is a list of the main dynamic codes supported by Contactsend.

Code name Open tag Close tag Media Description
USER_DATA_TAGS ${ }$ all Values includes, for each recipient, from the fields of the db associated to the group in use.
INLINE_CONTENT_TAGS @( )@ email URL to retrieve and embed files (for example images) in the message body.
DYNAMIC_INLINE_CONTENT_TAGS ^( )^ email Similar to INLINE_CONTENT_TAGS but supporting the use of other dynamic codes in the URL, like: USER_DATA_TAGS, NOTES_TAGS
TRACKED_URL_TAGS %{ }% email It genereates a syntax for statistical tracking of link clicks.
DYNAMIC_TRACKED_URL_TAGS ^{ }^ email Similar to TRACKED_URL_TAGS but supporting the use of other dynamic codes, like: USER_DATA_TAGS, NOTES_TAGS
ERB_TAGS <% %> all It processes ERB tags in the message, if any.
EXTERNAL_SOURCE_TAGS @{ }@ all Some content (tipically an html file) is retrieved via an URL and included in the message.
INCLUDE_URL_TAGS <@ @> all Similar to EXTERNAL_URL_TAGS but supporting the use of other dynamic codes in the URL, like: USER_DATA_TAGS, NOTES_TAGS
NOTES_TAGS <{ }> all It allows you to include the value of one of the saved labels.

Now, for each part of the message, we list the pipeline order (from top down) for codes processing. The processing order is important in case you want to use a dynamic code in a specific step of campaign creation: in order to do that, Contactsend must have already processed it in that phase of the message creation.




Mail from and Reply to:


HTML body


Plain text body:



Message body:


Base customization


We can apply a base customization to our message through the ″USER_DATA_TAGS″ code, that allows us to take values from the database associated to the (email/sms) group we are using, and place it inside the message.


  • Check that in the database associated to the group in use, there’s a field relevant to our purpose.

For example, if we want to start our message with: ″Dear John″, ″Dear Mary″ and so on, basing on our recipients’ first name, we need to have a field with users names in our db.

Let’s say this field is called NAME (all in capital letters).

  • Now put the cursor in the exact point (either in the visual editor, PageBuilder, or directly in the html code) of the message.
  • Type: Dear ${NAME}$

Note: the dynamic code is case sensitive, so please pay attention to write it exactly as it is named in the database.

If we are in the ″Message contents″ step of the campaign creation wizard, we can use the relevant dropdown menues to place the code inside our html. The email medium also allows to make the senders details (mail from and reply to address) dynamic, if globally enabled on the email group.

You can also insert more than one dynamic code in your message; for example:

Dear ${FirstName}$ ${LastName}$, we inform you that your user account ${Username}$ is about to expire.

You can automatically modify the values of included fields using:

Field modifiers

The field modifier syntax allow you to apply changes to the values taken via the USER_DATA_TAGS codes, such as: ${field_name}$ . Modifiers change the visualization of data taken from a database field. You can apply more modifiers to the same field. They will be executed in a pipeline.

This is the modifiers syntax: ${field_name|modifier}$ where:

  • field_name: is the name of the field in the user db. It is, once again, case sensitive.
  • modifier: is the name of the modifier you want to apply to that field.

Here’s list of available modifiers, with a description and examples:

– default

You can a default value in case the field is NULL or empty.

${name default:″″}$


(name = ″Mary″) Dear ${name|default:″customer″}$ => Dear ″Mary″

(name = ″″) Dear ${name|default:″customer″}$ => Dear ″customer″

In the example above, if the field ‘name’ is empty, the word ‘customer’ will appear instead.

Specific use case: use withing the ″a″ html tag. Let’s say we want to use this modifier withing the href attribute, this way: href=″${Domain|default:″″}$″ to display for each user the URL contained in his/her Domain db field, or if empty.

The syntax above will NOT work, as the output will be an invalid link. Use the following instead: href=″${Domain|default:’’}$″ where the default URL is surrounded by ‘ instead of ″ (double quote).

– date_format This formats date fields using these placeholders: %d – month day number (from 00 to 31) %m – month as a number (from 01 to 12) %y – year as a two digits number (from 00 to 99) %Y – year as a four digits number


(birth_date = 1992-04-15)
${birth_date|date_format:″%d/%m/%Y″}$ => ″15/04/1992″**

The date field must be in mysql format: yyyy-mm-dd If the date is not in mysql format, use the date_parse modifier instead (see below) and then the date_format modifier.

– date_parse Creates a date from a string, and then you can format it via the date_format modifier; it user the same syntax of date_format.


(birth_date = ″1992/04/15″) ${birth_date|date_parse:″%Y/%m/%d″|date_format:″%d-%m-%y″}$ => ″15-04-92″**

– string_format It allows you to format a text string.


(value_1 = 23.5787446) ${value_1|string_format:″%.2f″}$ => ″23.58″**

In the example above, value_1 will be rounded at second decimal digit.

– substring It extracts a portion of the string, between starting portion (included) and final portion (excluded). If final portion exceeds string length, result ends with the end of the string. The string start is marked with ″0″ (zero).


(value = ″abcdefg″) ${value|substring:″0″:″5″}$ => ″abcde″ ${value|substring:″2″:″5″}$ => ″cde″ ${value|substring:″2″:″100″}$ => ″cdefg″

– capitalize It capitalizes only the first letter of the string.


(full_name = ″joseph guerrisi″) ${full_name|capitalize}$ => ″Joseph guerrisi″

– lower (o lowercase) Changes all letters in the string to lower case.


(full_name = ″Joseph Guerrisi″) ${full_name|lower}$ => ″joseph guerrisi″

– upper (or uppercase) Changes all letters in the string to upper case.


(full_name = ″joseph guerrisi″) ${full_name|uppercase}$ => ″JOSEPH GUERRISI″ **

– swapcase Changes lower case to upper, and upper case to lower.


(full_name = ″Joseph Guerrisi″) ${full_name|swapcase}$ => ″jOSEPH gUERRISI″ **

– reverse Reverts the string.


(full_name = ″Joseph Guerrisi″) ${full_name|reverse}$ => ″isirreuG hpesoJ″

– urlencode Codes the string for use in URLs.


(full_name = ″Joseph/Guerrisi″) ${full_name|urlencode}$ => ″Joseph%2FGuerrisi″

– urldecode The contrary of urlencode

– replace Find & Replace; it is case sensitive. The first parameter is the string to be replaced, the second is the string that will replace it.


(full_name = ″Joseph Guerrisi″) ${full_name|replace:″Joseph″:″John″}$ => ″John Guerrisi″

In the example above, all fields containing the name ″Joseph″ are replaced by the string ″John″.

– md5 (o md5sum) It calculates the md5 checksum

Example: (full_name = ″Joseph Guerrisi″) ${full_name|md5}$ => ″a5887a62d652d2b476e57f20bbbc8c2c″

– base64encode Base64 encoding


(full_name = ″Mario Rossi″) ${full_name|base64encod}$ => ″TWFyaW8gUm9zc2k=″

– base64decode The contrary of base64encode


You can apply more modifiers to the same field, creating a pipeline: the result of a modifier will be passed to the follwing modifier.


(field2 = ″″) ${campo2|default:″Not Available″|lowercase|urlencode}$ => ″not+available″

(birth_date = ″1992/04/15″) ${biirth_date|date_parse:″%Y/%m/%d″|date_format:″%d-%m-%y″}$ => ″15-04-92″

Advanced customization


Trough relevant tags placed in the html code, you can include in that point an external content (tipically, a portion of html code or a full html file).

  • Let’s suppose we want to automatically send, on a daily basis, contents from our web page
  • At the ″Message contents″ step of the Create > Email campaign wizard, we place the following dynamic syntax inside the message body:@{}@
  • Content at that address will be automatically included in the message.

Attention: content will be retrieved at the moment when the message is generated, so please be sure in that moment you have the correct contents at that URL.


Similarly to EXTERNAL_URL_TAGS, it allows you to include files from an external URL, but it also supports the use of other dynamic codes.



that for users from the US will retrieve contents from
http://oursitecom/us/dailynews.html , for users from the UK from and so on.


@( and ^(${country}$/pic1.jpg)^
retrieve the image from the URL, and embedded it into the message body. The use of embedded images, on one hand makes them immediately visible in the email, because they’re inside the message body itself and not attached or retrieved on the fly from an external source. On the other hand, the message is heavier, and the anti-spam blocking more risky. For those reasons, we suggest not to use embedded images.


This syntax is normally automatically placed by Contactsend in the message body, during the email campaign creation process, to allow link tracking and clicks counting. The syntax of TRACKED_URL_TAGS can be inserted manually, for example when you need to track URLs containing dynamic parameters. For example:${country}$

In case dynamic parameters are placed in different points of the URL, or in the domain itself, you can use a syntax like DYNAMIC_TRACKED_URL_TAGS , as in the following examples: ^{${country}$/docs/index.html}^ ^{${domain}$}^

ATTENTION: to avoid slowing down message preparation and broadcasting, please do not use this syntax when you have many unique values, on sending with a high number of recipients.


Typing the name of a campaign label, it allows to include its value.

For example <{client_id}> places the relevant value in the point where the dynamic code is present (like a placeholder).