Dynamic Tags are pieces of text that are replaced with their corresponding value of what they represent. Use them to personalize your email content, subject line or any other element that support those tags.
For example **|user.firstname|** will be replaced with the user firstname when the email is sent or preview.
Depending on their usage place those can contain information about:
- campaign: **|campaign.type|** will display campaign type.
- _id, title, type, newsletter.sentDate are available
- template **|template.title|** will display template title
- _id, type, title are available
- user: display user attributes. **|user.country|** will display user country
- any user attribute
- event : display attributes from the event. **|event.query|** will display query value for search event
- for each event a set of distinct attributes are available
- event attributes are available for emails triggered by an event: transactional or workflow campaigns only
- voucher (only available in transactional and workflow campaigns) **|voucher_code|**. View Setup -> Coupon codes
Modifiers represent various methods that are applied to the value of those dynamic tags. We support the following modifiers:
- date: will turn a numeric date into a readable text
- truncate(param): truncate the value to maximum length specified in param. Default is 30
- pretty_price(param): value gets rounded to 2 decimals. If param passed is true than decimals are removed for values that are round. Pass false if you need to display 2 decimals, also .00
- md5: convert to md5
- b64encode: encodes to base64
- b64decode: decodes from base64
If the attribute is missing, you can set a default value to be displayed. This can be used for any tag. Add |default(‘default_value_here’) after the tag name, so in the end will look like this:
- Tags and Modifiers are case sensitive: event.Generic.Name will not match the generic field of an event, and neither attribute if it’s sent as name
- Event.generic.x attributes are only available for workflow and transactional campaigns
- Modifiers are only valid within email campaigns and interaction campaigns that are generated on the server side.
- Not valid tags are removed (replaced with empty string) if there is not data to be replaced with.