All Collections
Templates
How to use merge fields
How to use merge fields

Learn how to use merge fields to personalize your emails.

Support Team avatar
Written by Support Team
Updated over a week ago

Merge fields are special tags used in your emails and templates that will be replaced with appropriate content. Note some merge fields require a contact record to work while others like {unsubscribe} or {view} do not. We recommend using your own logo for tags like unsubscribe so contacts feel comfortable. Logo and company details can be specified in your Profile which is available on your Account Screen.

Important note! Always use single brackets when you create a merge field. Please double-check your templates if you're importing them from another source and change any double brackets to single ones.

Please also note that the below examples show two different ways of implementing merge fields:

  • {example1} - plain merge tag in curly brackets. A merge tag in this form can be included directly into a template created with our drag and drop editor, e.g. into a "link" field of a button.

  • <a href="{example2}">Example text</a> - a merge tag in curly brackets embedded into a HTML hyperlink tag. This example is intended for templates composed in our rawHTML editor.

{unsubscribe}

  • Generates a URL which can be used in a link.

  • Contacts are directed to a form to unsubscribe.

  • Contact status will change to Unsubscribed.

This feature is explained in detail in this article: link

{contactprofile} and {contactprofile:publicformid}

  • Generates a URL which can be used in a link.

  • Contacts are directed to a form to update their contact information. With the {contactprofile} tag, only email, firstname and lastname fields are available.

  • You can create a custom form with your custom fields and use the {contactprofile:publicformid} replacing the publicformid with your actual publicformid for the given form you would like to use.

{pullcontent-title:url}

  • Will display the title of the webpage at the specified URL.

  • Can be used in an email's subject.

  • Example:

{pullcontent-title:https://elasticemail.com/}
  • Important note! The link needs to come from an existing site and has to include the http or https!

{pullcontent:url}

  • Will render the HTML of the webpage at the specified URL.

  • Can be referenced and modified within scripting fields using Javascript. You can find more details on template scripting here: link

  • Content is cached on our server (Cache time is 5 minutes).

  • Example:

{pullcontent:https://elasticemail.com/}
  • Important note! The link needs to come from an existing site and has to include the http or https!

{pullcontent-rss:url,count=X,newcontentonly}

  • Will download and render the contents of the RSS feed into your email.

  • Url is the Url of the feed.

  • Optional: "count=X" - replace X with the number of items from the feed you would like to include.

  • Optional: "newcontentonly" - if this parameter is present then the tag will only pull down items from the rss feed that have been added since the last time this tag was used. 

  • Example:

{pullcontent-rss:https://elasticemail.com/feed/}
  • Example:

{pullcontent-rss:https://elasticemail.com/feed/,count=3}
  • RSS content will be rendered with the following format:

<div class="media-item">
<img src="..." />
<div class="media-item-body">            
<h5><a href=”link”>Media heading</a></h5>
Media Description - Example: Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</div>

{msgid}

  • Displays the email's MessageID.

  • The MessageID is the email's unique identifier that is found in the message headers.

  • Example:

Unique Identifier: {msgid}

{view}

  • Generates a URL that can be used in a link. It is used as a default activation link for subscriber activation.

  • Will open and display the email in the internet browser.

  • Used for "View on the web".

  • Example:

<a href="{view}">View On Web</a>

{url}

  • Generates a URL for Subscriber activation.

  • This is the link you will use when you want to send an email that allows your Sub-Accounts or Subscribers to activate.

  • Example:

<a href="{url}">Activate</a>

{consent}

  • Generates a link used for Subscriber's consent confirmation.

  • Gives you a recent record of consent from any contact that clicks the link.

  • Example:

<a href="{consent}">Confirm</a>
  • It is possible to link the consent buttons to your own "thank you" page.

<a href="{consent:https://yourownpage.com/}">Confirm</a>

{consenttrackingallow} and {consenttrackingdeny}

  • Generates a link which is used to confirm if the Subscriber allows or denies tracking opens or clicks of their emails. (More details: here.)

  • Example:

<a href="{consenttrackingallow}">Allow tracking</a>
<a href="{consenttrackingdeny}">Deny tracking</a>
  • It is possible to link the consent buttons to your own "thank you" page.

<a href="{consenttrackingallow:https://yourownpage.com/}">Allow tracking</a>

Contact Merge Fields

The following merge fields can be used when sending to contacts uploaded to your account:

  • {recipient} **Note when this is used, it will default to contact's firstname if available, then lastname, then email address.

  • {email}

  • {firstname}

  • {lastname}

  • It's possible to create custom contact merge fields - eg. if you upload a contact list with a "phone" field, you will be able to call it via {phone}.

Merge Field Fallbacks

It is possible to create a "fallback" for merge fields when the value is not provided (eg. contact didn't provide his/her name):

{mergefieldname:fallbackvalue}

If the value in the merge field is empty (null) it will use the second value. Example:

Hello {firstname:friend}!

If "firstname" value exists on the contact, the merge field will use the content of the "firstname" (eg. "Hello Adam!"), otherwise it will use the second value provided after the ":" sign (eg. "Hello friend!").

Please note that custom values for merge fields have a limit of 100 characters in total.

Profile Merge Fields

These fields are used to display your profile information in the email's body. More information can be found here: link

  • {accountaddress}

  • {accountemail}

  • {accountfirstname}

  • {accountlastname}

  • {accountcompany}

  • {accountaddress1}

  • {accountaddress2}

  • {accountcity}

  • {accountstate}

  • {accountcountry}

  • {accountzip}

  • {accountphone}

  • {accountwebsite}

Transactional Templates

Elastic Email gives you option to use Templates created with our Email Designer or HTML Editor in your transactional emails. This feature allows you to pass personalized content to each of your recipients. You can find more details here: link

Did this answer your question?