What is Dynamic Email Content?

Dynamic email content allows you to tailor your email messages to the interests of each subscriber. There are a lot of different variables that you can pull into your messages, like subscribers' geographic location and their personal information. Content that is more relevant to subscribers often translates into increased engagement in terms of opens, clicks, and conversions.

Where can I use dynamic email content?

You can make use of dynamic email content anywhere in the AWeber message editor, including the subject line.

How do I write dynamic email logic?

In order to code for dynamic email content in your messages, you would have to include the logic tags below. 

{{ ... }} Print the value of a subscriber variable
Hello {{ subscriber.name }}
{% ... %} Evaluate an expression
{% if subscriber.signup.city == 'Philadelphia' %}
Local deals in Philly!
{% endif %}
{# ... #} Write comments in your message that are not seen by your subscribers.
{# This is a hidden comment. #}
{% raw %} Markup within the raw tag will not be evaluated as a variable or statement.
Here is how I personalize my email greeting:
{% raw %}
Hello {{ subscriber.first_name }}.
{% endraw %}

 

Operators

Operators help you display specific content if certain conditions are met. If the first condition outlined by the "if" operator is not met, then the system will look to another condition based on the "elif" operator. If neither condition is met, then the system will look to the content with the "else" operator.

if Display message content IF the statement is true.
{% if subscriber.custom_field['pet'] == 'dog' %} 
Save 20% dog food!
{% endif %}
elif If the first condition isn't met, evaluate another condition.
{% if subscriber.custom_field['pet'] == 'dog' %}
Save on dog food!
{% elif subscriber.custom_field['pet'] == 'cat' %}
Save on cat food!
{% endif %}
else Display the following content to subscribers that did not meet any of the conditions above.
{% if subscriber.custom_field['pet'] == 'dog' %}
Save on dog food!
{% elif subscriber.custom_field['pet'] == 'cat' %}
Save on cat food!
{% else %}
Save on pet food!
{% endif %}

 

Comparison Operators

Comparison operators work in conjunction with the operators above.

== equal to
!= not equal to
> greater than
>= greater than or equal to
< less than
<= less than or equal to

 

Filters

Filters help you customize the content by capitalizing specific letters, displaying fallback content when the subscriber doesn't have a value, and displaying a random option from a set of choices.

upper Converts each character in a string to uppercase
{{ "hello there" | upper() }}
HELLO THERE
lower Converts each character in a string to lowercase
{{ "HELLO THERE" | lower() }} 
hello there
capitalize Capitalizes the first word in a string
{{ "hello there" | capitalize() }}  
Hello there
title Capitalizes each word in a string
{{ "hello there" | title() }} 
Hello There
default Provides a fallback if the variable has no value assigned
Dear {{ subscriber.first_name or "friend" }},
Dear friend,
random Display a random item from a set of choices
{{ ['Apples', 'Oranges', 'Grapes'] | random }}
Oranges

For more information on dynamic email content, and the different types of variables that you can include when coding for dynamic email content, check out the articles below:

Have more questions? Submit a request
Powered by Zendesk