Skip to main content
Placeholders and Sources
Updated over a month ago

Placeholders and Sources

Here are a few words about the supported formats, file sizes and details about how to use placeholders with the tags from your source file.

Curious about Dynamic assets? Read more about Creating a Dynamic asset and Using Dynamic asset.


In this Article


Supported Sources

Dynamic assets support JSON, XML and RSS sources up to 10 MB or under

Is your source file too large?

The server that hosts your file source must accept HEAD requests. You can check if your server accepts them by using a REST & SOAP API testing tool, like this one.

We support the following Content-Type in GET and HEAD requests:

application/json 
application/xml
application/rss+xml
text/xml

When fetching the Dynamic asset's content from your source/remote server, Efficy will wait for up to 5 seconds for the server to respond. If the server doesn't respond, the request will be canceled and an error message will be displayed.


Source filtering

Source files over 10 MB are not supported, and will need to be reduced before being filtered.

If your source file exceeds 50 items, you can use a filtered version of that feed in the platform instead of creating another one. Without source filtering, only the first 50 items will be fetched and displayed in the Dynamic asset when using Fetch all.

To insert more items, you can add the Asset again. This solution requires that your source has a script that can accept specific parameters in the URL, so that it can return content based on your parameters. For example:

Afterwards, you can apply any additional filtering and adjust your Dynamic asset setup.


About Placeholders

When creating a Dynamic asset, you must add placeholders in your Asset so that they're replaced with the data from your source (JSON, XML or RSS, 10 MB max).

Although you won't be able to see this data when creating the Asset, it will be visible once you add the Asset into the Canvas in an Email draft.

Format and size

Placeholders must be formatted as: {{placeholder}} For example: {{title}}, {{description}}, {{imageUrl}}.

The maximum file size for sources is 10 MB, and the server that hosts your file must accept HEAD requests. The maximum number of items inserted in an Email activity is 50.

To insert more items, you can add the Asset again.

Filter them either by ID or by number of items.

assets25.jpg

The text or name of the placeholder depends entirely on your source. If your source file looks something like the one above, the placeholder in your Asset will be replaced with its content when using this Asset in an Email draft.

So, {{title}} will be replaced with the hotel's name, {{description}} with the hotel's description, and {{imageUrl}} will become the Image Element's image URL.

Editing Placeholders

Placeholders can only be edited when editing the Asset directly from the Assets tab. Any changes made in the Email draft after adding the Asset will only affect that specific Email activity.

💡Tip!

Go to the Dynamic assets: Placeholders examples article to see some placeholder!


Placeholder Types

These are the types of placeholders you can use in your Dynamic assets:

Type

Examples

Description

Simple

{{name}}
{{imageURL}}

A standard placeholder that points to a specific item in your source file.

Sequence

{{seq:1.name}}
{{seq:2.name}}

{{seq:1.imageURL}}
{{seq:2.imageURL}}

A number of placeholders that result in a sequence of items in your source file. Can point to root items as well as nested items.

About Sequence placeholders

The first thing to have in mind when working with Sequence placeholders is whether you wish to work with root or nested items.

In Loop Settings you can read more about the available options.

All Sequence placeholders must come with a number that indicates the progression of items in your file (e.g. {{seq:1.name}} and {{seq:2.name}}).

It is not necessary that you add as many placeholders as items in your file, as two will suffice. You can limit how many items should be fetched in the Loop settings.


Placeholders as Links

As mentioned above, placeholders can be used anywhere in the Email Canvas, including links.

While in the Element options or the Inline Text editor, expand the Link type and choose Feed Property.

In the example Asset above, the "Book now" Button element has been set up with {{url}} as a link! So, when this Asset is added into a draft, the placeholder is replaced with the URL from your source.

assets23.jpg

Placeholders and Tags in XML and RSS

If you intend to use XML or RSS source in your Dynamic asset, like this one:

<items> 
<item>
<title>One</title>
<img src=“http://www.apsis.com/items/one.png”/>
<description header=“One”>Description of One</description>
</item>
<item>
<title>Two</title>
<img src=“http://www.apsis.com/items/two.png” />
<description header=“Two”>Description of Two</description>
</item>
<items>

You must pay special attention at how you use placeholders to target the Tags in your source.

To use a Tag like the item's title (<title>), simply use {{title}} as a placeholder.

To use a Tag with Attributes, like the item's image (<img src="(...)" />), you must use {{img.@src}}.

Meaning that, for Tags with Attributes you must specify the Attribute in your placeholder as {{tag.@attributeName}}

However, when it comes to Tags with Attributes and text, like the item's description (<description header="One">Description of One</description>) you must use {{description.#text}} to target the Tag's text (Description of One).

To target the same Tag's Attribute (header="One"), follow the example above and use {{description.@header}}.


Fetching Source data at send out

When using your Dynamic asset in an Email draft, you will be asked whether you'd like to fetch the data from your source immediately or if you would like to fetch the data when the Email is sent.

Here are some aspects to consider if you choose to fetch at send out:

  1. Any Row Segmentation in the Dynamic asset will be ignored in Preview and Test.

  2. When fetching content on send-out, Google Analytics settings applied in the bottom bar will be used in all links in the Asset.

  3. Email created and sent in Email tool:

    When you add the Dynamic asset into your email, the Dynamic asset will fetch the existing content and create a cache copy. If the email is sent within the next five (5) minutes, the cache copy will be sent.

    If any changes are made in the Row settings, or those five minutes pass, the Dynamic asset will fetch the latest data for a new cache copy. This also applies if the Email activity is cloned.

  4. Email sent through a Marketing Automation flow (Email node):

    Your content will be fetched every five (5) minutes. In other words, the Dynamic asset will update the content of the email every five minutes, and Profiles will receive the version that contains the latest version within those five minutes.

    The content will only be updated if there are new Profiles entering the flow; if there aren't any new Profiles in the flow, content will not be fetched until a Profile enters your flow.


Next Step

Did this answer your question?