What variables can I use to create dynamic email content?

The variables below are small snippets of code that will pull specific subscriber and list information into your messages. For example, if you wanted to greet your subscribers and address them by their first names, then you would use "{{ subscriber.first_name }}" in the message. Similarly, if you wanted to add an additional unsubscribe link to your message, then you would use "{{ subscriber.unsubscribe_link }}."

You can also use these variables, as well as other codes like operators and comparison operators, to display specific content as long as certain conditions are met. There are a lot of different ways that you can use dynamic email content in your messages, but these variables are the building blocks to help you code dynamic email content.

Subscriber Information

Full name

This variable will pull the subscriber's first and last name into the message if both are available.

{{ subscriber.name }}

First name

This variable will pull only the subscriber's first name, before the first space. For example: if the subscriber's name is listed as "John Joseph Smith," the variable would only pull "John."

{{ subscriber.first_name }}

Last name

This variable will pull only the subscriber's last name.

{{ subscriber.last_name }}

Email address

This variable will pull the subscriber's email address.

{{ subscriber.email }}

Identifiers

A unique subscriber identifier (int)

{{ subscriber.id }}

A unique subscriber identifier (UUID)

{{ subscriber.uuid }}

Tags

You can use this variable to create content tailored to subscribers that are labeled with various tags.

{% if "premium_customer" in subscriber.tags %}
<p>Welcome back to my store!</p>
{% else %}
<p>Welcome to my store!</p>
{% endif %}

Custom fields

You can use this variable to create content tailored to a specific custom field. You will have to replace 'FIELD_NAME' with the name of the field you created.

{{ subscriber.custom_field['FIELD_NAME'] }}

custom_field.gif

 

Unsubscribe link

This variable will add an additional unsubscribe link.

{{ subscriber.unsubscribe_link }}

 

Subscriber Sign Up Details

Date

This variable shows the date that a subscriber was added.

{{ subscriber.signup.date }}

Sign up URL

This variable will show the URL where the subscriber signed up for your list. Note: most API integrations will not pass the URL to AWeber.

{{ subscriber.signup.url }}

Unsubscribe URL

{{ subscriber.unsubscribe_link }}

City

This variable will pull the city based on the IP address where the subscriber signed up.

{{ subscriber.signup.city }}

Postal code

This variable will pull the postal code based on the IP address where the subscriber signed up.

{{ subscriber.signup.postal_code }}

Country

You can use this variable to tailor messages to subscribers in specific countries.

{{ subscriber.signup.country }}

Region

You can use this variable to tailor messages to a specific region, like a province.

{{ subscriber.signup.region }}

DMA

This variable utilizes the subscriber's Direct Marketing Association code

{{ subscriber.signup.dma_code }}

Longitude

This variable will use the subscriber's longitude.

{{ subscriber.signup.longitude }}

Latitude

This variable will use the subscriber's latitude. 

{{ subscriber.signup.latitude }}

 

Message Details

Archive URL

You can use this variable to display your broadcast archive URL.

{{ message.archive_url }} 

Message ID

After a broadcast is sent, the variable will render an integer message id.

{{ message.id }} 

List Details

Global Fields

This variable will pull any of your global text snippets in your list settings. You just have to replace 'FIELD_NAME' with the name of your snippet.

{{ list.global_field['FIELD_NAME'] }}

Signature

This variable will add your email signature.

{{ list.signature }}

Company Name

This variable will show your company name.

{{ list.company_name }}

List Contact Address

This variable will add your CAN-SPAM mailing address.

{{ list.contact_address }}

Identifier

A unique List identifier (int)

{{ list.id }}

A unique List identifier (UUID)

{{ list.uuid }}

Ignore

While the double curly braces are reserved for dynamic content, occassionally you may want to use them for other purposes. In order to have our dynamic content system ignore that content, you may wrap it in a {% raw %} block:

For example:
{% raw %}
Hello {{ subscriber.first_name }}.
{% endraw %}

For more information on dynamic email content, and how to utilize personalizations in your messages, check out the articles below:

Have more questions? Submit a request