At the most basic level, FreeMarker code is a great way to dynamically insert values from Lead/Contact/Account/User records into Click email templates. However, the scope for ways to use FreeMarker code is very large, and it can be used for a number of purposes beyond just displaying dynamic content.
Dynamic Content in Links
FreeMarker can be used to pull a value from your environment into a URL as a link parameter, or to pull in an entire URL.
When pulling an entire URL, if you want clicks on the link to be trackable you will need to hardcode the http/https protocol in your Email Template while leaving the protocol out of the URL value referenced by your freemarker.
If you dynamically pull in a URL with protocol from a Dynamics field, rather than hardcoding the protocl in the Email Template, the link you've created will not be tracked.
Subject Line, From Name, From Email, & Reply To
You can use a FreeMarker interpolation in an Email Send’s Subject Line, From Name, From Email, and Reply To fields by placing the FreeMarker in the appropriate field on the Email Send record.
Time Stamps
You can also use FreeMarker to place time stamps into your emails:
Date only, no time: ${.now?date}
Time only, no date: ${.now?time}
Date and Time: ${.now?datetime}
Note: These are some of the only interpolations that render in Test Emails. They do not reference data on a specific record in your environment and thus do not need to be sent to a specific recipient in order to render. Data from records that have a Connection with the Email Send records will also render in Test Emails.
Feature Added: Original |
Feature Updated: 6.7.0 |
Click Version Needed: 6.7.0 |