Using Fusion

Vero's Fusion feature allows you to pull data from your own API or web endpoints so you can personalize your emails on a truly one-to-one basis.

It gives you the ability to access data that hasn't been pushed into Vero, and use that data in your email content, subject lines and dynamic attachments.

Example use cases:

  • You'd like to send off the top five new products in your store that day.
  • Pull in extra information about your users
  • You'd like to show relevant items based on the current stock.
  • You'd like to send customised content for each demographic (i.e. products based on location or even different languages)

Vero can handle two types of data responses:

Returning HTML

To do this you use a custom filter we've built using the Liquid templating language.

This method allows you to pass data stored in Vero back to your server so that you can manipulate it and send back some custom HTML. The custom HTML that is returned is inserted into the body of your email exactly where you place the following tag:

{% raw %}
	{% fetch_html 'https://www.domain.com/endpoint' %}
{% endraw %}

In this example below, we pass back both a customer-level attribute and an event-level attribute. This data can then be used by your server!

{% raw %}
	{% fetch_html 'https://www.domain.com?param={{user.id}}&param2={{event.number_of_widgets}}' %}
{% endraw %}

You should of course replace the domain in this example with whatever URL you prefer. This URL should return raw HTML that will be dumped into the body of your HTML campaign exactly as it is returned.

Here is how you might insert this code into the body of your email: vero.fetch-html

This would then be replaced with the correct HTML upon sending.

Returning JSON

Alternately, you can include an API endpoint and pull JSON data from your web server to be used when creating a campaign.

There are two ways of accessing external JSON data.

Add an external data source

To add an external data source for your email, you can edit the External Data section of a campaign and add your api endpoint..

vero.fusion-data-inspector

For example, if the endpoint was:

http://jsonplaceholder.typicode.com/posts/1

The contents of the endpoint would show:

vero.json-data

Then, when you place {{external.title}} inside of your content (or template as well), the result in the preview would show the title pulled in like so:

vero.external-attributes-preview

Fetch JSON liquid filter

The fetch_json liquid filter works in a similar way as the fetch_html filter above, but instead expects a JSON response.

{% raw %} {% fetch_json product = 'https://www.domain.com/products/{{event.product_id}}' %} {% endraw %}

After adding this to your template or email body you can then access the returned data using the product liquid variable. e.g:

{% raw %} {{json.product.product_name}} {% endraw %}

Response codes and retries

Fusion expects to receive a 200 response code in order to send emails.

If a Fusion request receives a 204 response, it will not retry the request and Vero will discard the email immediately. This can be used to tell email to discard certain emails to customers, or to prevent Vero from retrying a failed request. For example, if you didn't want Vero to retry requests, you could develop your API to catch errors and return a 204 in the event of any failure.

If a Fusion request receives anything other than a 200 or 204 response code, it will continue to retry the request up to five times.

Note that Vero retries emails with failed Fusion requests at increasing intervals. If your endpoint continues to return non-`200` response codes, the fifth attempt could be several hours after the initial request was made.

Authentication

At this time Fusion only supports basic HTTP Authentication. You can include basic HTTP Authentication details using the format http://username:password@yoururl.com/data-feed.json. This is supported by fetch_html, fetch_json and JSON fetch methods.

Fusion is an advanced feature. Please get in touch with our support team via email so we can show you it in action.

Author

  • Reba Moyes
    Head of Customer Success