Personalize your email with dynamic content

Attentive’s dynamic content allows you to customize emails for each subscriber:

As you edit your email, you'll see placeholder text for personalizations (e.g., {{subscriber.firstName}}). You can always preview your email to see what it will look like to subscribers. And in the actual email, subscribers will see content that's personalized for them, such as their name, images of or links to products, unique discount codes, and more. 

Variables and dynamic links

Below is a list of variables and dynamic links you can use in your emails. Keep in mind that some variables and links are only available for specific journeys.

Personalization Definition Type
{{subscriber.cartLink}} Link to the subscriber’s shopping cart. This link requires an integration with Shopify and only appears in certain journeys. Dynamic link

{{companyAddress}}

Your brand’s address (as entered in Settings)

Note: If you add the {{companyAddress}} variable to your messages, it retrieves the address from your default region (marked by the Default label on the Company regions page.
Variable

{{companyLink}}

Link to your brand’s website Dynamic link

{{offer.code}}
{{subscriber.signupOffer.code}}

Dynamic discount code (e.g., ATTV-OLCHY8)

Variable

Dynamic discount code

Auto-apply link

{{offer.link}}
{{subscriber.signupOffer.link}}

Link to your store with the offer already applied

Dynamic link

Dynamic discount code

Auto-apply link

{{offer.value}}

Offer value (e.g., $10 or 10%). The offer must have a Discount amount (optional) set up if you want to add the this variable to a message. See Create offers for more information.

Variable

{{subscriber.firstName}}

Subscriber’s first name (if stored in Shopify) Variable

{{subscriber.fullName}}

Subscriber’s first and last name (if stored in Shopify) Variable

{{subscriber.lastName}}

Subscriber’s last name (if stored in Shopify) Variable

{{subscriber.custom[“custom attribute”]}}

Example:
{{subscriber.custom[“Favorite color”]}}

Subscriber’s custom attribute (from API or created in Attentive) Variable

{{triggerEvent.product.image}}

Image of the product that initiated the journey. Dynamic product image

{{triggerEvent.product.link}}

Link to the product page in your Shopify store Dynamic link

{{triggerEvent.product.name}}

The name of the product from the triggering event. This variable is only available for emails in certain journeys (e.g., cart abandonment). Variable

{{triggerEvent.product.price}}

The price of the product from the triggering event. This variable is only available for emails in certain journeys (e.g., cart abandonment). Variable

{{triggerEvent.product.quantity}}

The quantity of the product from the triggering event. This variable is only available for emails in certain journeys (e.g., cart abandonment). Variable

{{triggerEvent.product.link}}

Link to view the product on your website. This link only appears in certain journeys. Dynamic link

{{unsubscribeLink}}

Link to unsubscribe from marketing emails Dynamic link

{{webView}}

Link to view the email in a web browser Dynamic link

Use app-specific variables and links in journeys

Some third-party apps in the App Marketplace come with their own journey triggers that let you use variables or dynamic links specific to those apps.

For example, if you’ve installed the Okendo app, you can create an Okendo review request journey. You can add links and variables specific to Okendo to messages in this journey, such as {{triggerEvent.custom["Product Review Url"]}}, which links to a URL where subscribers can review a product in Okendo.

Note: App-specific links and variables can only be added to messages when Attentive receives corresponding data from the apps you’ve installed. For example, one of the variables you can add to an Okendo journey message is {{triggerEvent.custom['Product Variant Name']}}, but you can’t add it to journey messages if Attentive doesn’t receive a product variant name from Okendo.

Some apps have additional custom subscriber attributes that can be added to messages as variables. For example, you can personalize messages by including subscribers’ favorite colors if that data is available from one of your installed apps.

To add a variable that uses a custom attribute from a third-party app, search for the variable in the Subscriber category in the Insert variable window. You can also scroll the Subscriber category until you find the section for the app that sends the attribute you’re looking for.

Selecting the 'Age' attribute from mParticle as a variable in the 'Insert variable' window.

Note: Custom attributes as variables are only available with the following apps:

  • Klaviyo
  • mParticle
  • Punchh
  • ReCharge
  • Segment
  • Shopify
  • Smile.io

Use variables in transactional journey messages

For transactional email and text message journeys, a number of app-specific links and variables are available. You can find them by adding a variable or link to a message, then selecting one specific to the journey in the Insert variable window.

You can see examples of transactional email messages that include journey-specific variables and links in the following articles:

Add a variable

Follow the instructions below to add a variable to your email:

  1. While designing your email, click the text content block where you want to add a variable.
  2. In the text editor, click Insert variable.
    Clicking insert variable in email editor
  3. In the Insert variable window, select a Variable.

    Note: Custom attributes with single or double quotes ( or ) in their titles can’t be used as variables and aren't available in the Insert variable window.
  4. (Optional) Enter a default value in the Default value (optional) field.
    • A default value is a value that appears when the variable has no value. For example, you might want to set “customer” as a default value for {{subscriber.firstName}}. This way, if a subscriber’s first name is unknown, Attentive will populate “customer” instead of a blank space in the actual email. See Default value examples below for examples. 
  5. Click Insert.

The selected variable now appears in your email. You can also use a variable to add dynamic discount codes to your email. 

Default value examples

Hey {{ subscriber.firstName | default:”girl” }}, we have your perfect shade {{ subscriber.custom[“foundation quiz result“] | default: “Glow-for-All” }} in stock!

Hey Jane, we have your perfect shade Tint 01 in stock!

If data (first name, custom attribute) is unavailable:

Hey girl, we have your perfect shade Glow-for-All in stock!

How do you like your new {{ triggerEvent.product.name | default: “item” }}?

How do you like your new Men’s Downpour Rain Jacket?

If data (product name) is unavailable:

How do you like your new item?

Add a dynamic discount code

With the {{offer.code}} variable, you can add dynamic discount codes to your email. 

Follow these steps to add a dynamic discount code with the {{offer.code}} variable:

  1. Add an offer to your email.
  2. While designing your email, click into a content block in the location where you want to insert the variable.
  3. Click Insert variable.
    InsertVariable.png
  4. In the Insert variable window, select {{offer.code}}, then click Insert. The {{offer.code}} variable now appears in your email. Subscribers will see their personalized coupon code in place of the variable. You can also preview your email as a subscriber to see how your email will appear to recipients.
    OfferCodeInEmail.png

See Add an offer and include a discount code in your email for more information about offers in emails.

Add a dynamic variable from a custom event

If you send Custom Events API data to Attentive, follow these steps to add dynamic variables to your email using that data:

  1. Follow the steps in the Add a variable section above.
  2. From the Variable dropdown in the Insert variable popup, select Triggering event. Click a recently selected event or click Explore more to search for and select an event and property.
    Clicking 'explore more' in the 'Insert variable' popup to search for a property sent to Attentive via our custom event API.
  3. If you clicked Explore more, search for the object or property you want to use as a dynamic variable, and then click Select.
    Searching for and selecting a variable in the 'Select a property' popup.
    After you select a property, the Insert variable popup reappears.
  4. Click Insert.

Use variables in welcome journey messages

Because subscriber data isn’t yet available at initial sign-up, only the following variables are supported in welcome journey messages:

  • {{message.messageId}}
  • {{message.messageName}}
  • {{message.messageType}}

Add a dynamic link

Dynamic links direct subscribers to a personalized web page, such as their shopping cart, or the unsubscribe page.

Follow these steps to add a dynamic link to your email.

  1. While designing your email, click the text content block where you want to add a link.
  2. Select the text that you want to make into a link, then click Insert dynamic link.

    Clicking Insert dynamic link in email editor

  3. On the Insert dynamic link window, select the dynamic link you want to add, then click Insert.

The highlighted text is now a link in your email.

Add a dynamic link from a custom event

If you send Custom Events API data to Attentive, follow these steps to add dynamic links to your email using that data.

  1. Follow the steps in the Add a dynamic link section above.
  2. In the Insert dynamic link popup, select Triggering event. Click a recently selected event or click Explore more to see all events.
    Clicking 'Triggering event' in the 'Insert dynamic link' popup.
  3. If you clicked Explore more, search for the object or property you want to use as a dynamic link, and then click Select.
    Searching for and selecting a property in the 'Select a property' popup.

    Notes:

    • Select a property where the data sent to the Custom Events API is a URL, e.g., a link to an order status or shipping information page. After you select a property, the Insert dynamic link popup reappears.
    • To include UTM parameters in dynamic links for messages in custom event journeys, make sure the custom event payload sent to Attentive already contains these parameters.
  4. Click Insert.

Add an auto-apply link

With {{offer.link}}, you can add auto-apply links to your email. Subscribers who click the link in the email will receive the discount. 

Note: If your website doesn't support auto-apply links, or you don't enable auto-apply links for the discount code, your offer may not work. For more information, see Create offers.

  1. Add an offer to your email.
  2. While designing your email, click a content block where you want to insert the variable.
  3. Select the text that you want to make into an auto-apply link and click Insert dynamic links.
    HighlightLink.png
  4. In the Insert dynamic link window, select {{offer.link}}, then click Insert.
  5. The highlighted text is now a link in your email. Subscribers will see an auto-apply link to redeem the offer, as pictured below. You can also preview your email as a subscriber to see how your email will appear to recipients.
    LinkInEmailPreview.png

Add a dynamic link to a button or image

  1. While designing your email, click and drag a BUTTON content block to the email.
  2. Click the button or image you would like to add a link to.
  3. In the CONTENT panel on the right, click Insert dynamic link
    The Insert dynamic link option in the Content panel for a button in the Attentive email editor.
    The Insert dynamic link popup window appears.
  4. In the Insert dynamic link popup window, select a link, then click Insert.

Add variables to links

You can add variables to links in your emails to send your subscribers to unique URLs. For example, by adding dynamic variables to a link, you can send subscribers to personalized landing pages, enhance tracking, take better advantage of integrations, and more.

Follow these steps to add variables to a link:

  1. In the email editor, add a link to your email. You can click the link button when editing a row, add a link to an image, or add a link to a button. See Design your email for more information.
    The button to add a link to a row in an email message.
  2. In a paragraph block, insert the variable you want to add to a URL. Make sure to set a default for the variable, then copy the entire variable.
    Copying a custom macro with default value in text block so it can be pasted into a link.
  3. In the Insert link popup, enter the link in the Url field. Replace the part of the link that should be unique to the subscriber with the corresponding Attentive variable. We suggest inserting a variable to your email to see which variables are available, making sure to set a default value, and then copying that variable (with the default) and pasting it in the Insert link popup.
    The Insert link popup in the email editor with a URL that contains an Attentive variable.
  4. Click OK.
  5. Remove the variable you added in step 2 from your email.

There are many ways you can use variables in links. For example, imagine that you assign a custom attribute to subscribers based on the kinds of products they’re most interested in. You also set up separate landing pages for each kind of product. The URL you add to your link might look something like this:

https://www.yoursite.com/{{subscriber.custom['Product category'] | default: 'outerwear'}}

In this example, a subscriber with a custom attribute value of shoes would be directed to a landing page focused on shoes. Another subscriber who doesn’t have a custom attribute would be directed to a landing page about outerwear, since that’s the variable’s default value.

Here are a few other ways to use variables in links:

  • Enhanced tracking: Track metrics like where a subscriber came from or which sign-up unit they used. This information can help you analyze user behavior and make data-driven decisions.
  • Auto-login or soft login: Direct users to personalized pages based on a unique ID where they can be automatically logged in across devices, facilitated by cookies.
  • Non-Shopify cart links: If your brand isn’t on Shopify, you may be able to use variables in links to drive users to their unique shopping cart.
  • Dynamic images: Display images of previously purchased items by uploading unique URLs for each customer as attributes and then substituting the custom attribute variable into an <img> HTML string.

    For example, you can prepare unique IDs representing items that subscribers have purchased. In Attentive, you can upload these IDs to a custom attribute for each subscriber. You can then create a dynamic image URL by inserting the variable for the custom attribute in the Image URL field when inserting an image in the email builder. That URL might look something like the following: https://orchardstcoffee.com/cdn/shop/products/Nitro_CB_Oat_533x.jpg?v={{subscriber.custom['imageID'] | default: ''}}
  • Integration support: Macros can strengthen existing app integrations by enabling additional features, like dynamic content or product recommendations.
  • Advanced coupon assignment: If your brand isn’t on Shopify, you may be able to use a coupon variable in links in order to auto-apply coupons.

Use conditional logic with dynamic variables and links

You can add logic to your email so that content only appears based on a condition. For example, let’s say you want a certain message to appear to subscribers who purchased your brand’s signature dog toy. You want a different message to appear to subscribers who purchased your brand’s cat toy, and another different message to appear to subscribers who purchased any other item. 

Note: You must add conditional logic to an HTML content block while designing your email. See Design your email for more information about HTML and other content blocks in the email editor.

Learn more about conditional logic.

Conditional logic examples

{% if subscriber.custom[“which pets are you shopping for”] == “dog” %}

We hear you’re a dog-lover! Check out some great toys for your canine.

{% elseif subscriber.custom[“which pets are you shopping for”] == “cat” %}

Shopping for your feline? Check out our great toy selection.

{% else %}

Check out some great toys for your pet!

{% endif %}

If the subscriber responded they liked dogs:

We hear you’re a dog-lover! Check out some great toys for your canine.

If the subscriber responded they liked cats:

Shopping for your feline? Check out our great toy selection.

If no response is available:

Check out some great toys for your pet!

{% if subscriber.custom[“is VIP”] == Yes %}

Thanks for purchasing! Use {{offer.code}} for 10% off your next order.

{% else %}

Thanks for purchasing!

{% endif %}

If the subscriber is a VIP:

Thanks for purchasing! Use CODE10 for 10% off your next order.

If the subscriber isn’t a VIP:

Thanks for purchasing!

Add a dynamic product image

Dynamic images incorporate the image of the product that initiated the customer’s journey. If the product that initiated the event doesn’t have an image, the email isn’t sent. See Add dynamic product images to your triggered email for more information.

Add a dynamic list

If you send Custom Events API data to Attentive, follow these steps to add dynamic lists to your email using that data.

  1. In the email editor, click and drag a Dynamic list block into your email.
    The 'dynamic list' block in the email editor.
    The Choose a list popup appears.
  2. In the Choose a list popup, select a list from the dropdown.
    Selecting a list sent to Attentive via custom event API from the dropdown in the 'Choose a list' popup.
    The Add dynamic list page opens.
  3. On the Add dynamic list page, select the number of items to display, the layout, and individual list items to display.
    User view of the 'Add dynamic list' page, including options to specify the number of items displayed, the layout, and to select and edit individual list items.
  4. To customize a list detail item, click Add content next to the item. The Edit List Details popup appears.
    Clicking on a field with a 'plus' symbol in the 'Edit List Detalis' popup
    Depending on the type of list item you’re customizing, you can customize the following list details:
    • Image: Select an object as the image source and specify a redirect link (optional).
    • Text: Select an object as the source of the text, set a default value (optional), and specify a redirect link (optional).
    • Button: Select an object as the source of the button text and specify a button redirect link.
    • HTML: Enter custom HTML.
  5. In fields where you see a + symbol, click to open the Select a property popup to specify list details. The Select a property popup appears.Searching for a property sent to Attentive via our custom event API to use as a list detail item.
  6. Search for the object or property you want to use as a list item, and then click Select. The Edit List Details popup reappears.
  7. Finish selecting other properties as needed, and then click Submit. The Add a dynamic list page reappears. The preview on the right side of the page automatically updates as you add and customize list items.
  8. Click Continue.

     

    Learn more about Attentive Email

    If you're interested in learning more about Attentive Email, please submit your information here.

Articles in this section

Was this article helpful?
0 out of 2 found this helpful