Fetching a loyalty ledger in Iterable
In this tutorial, let's set up Iterable to retrieve the loyalty ledger information of a customer from Talon.One.
To do so, we rely on the Iterable-specific Get loyalty ledger endpoint.
Talon.One requirements
- You are an Admin user.
- You have set up an Application that contains customer profiles.
- You have set up a profile-based loyalty program.
Iterable requirements
- You have created a campaign and a template.
- You have added users to your Iterable project.
Your user data includes the user's first name and email address. For this tutorial, we assume the corresponding fields are named
firstName
andemail
. - You have a way to identify a given customer across Talon.One and Iterable. For this tutorial, we assume the customer integration ID in Talon.One is identical to the customer's email address in Iterable.
Creating an API key in Talon.One
In the Campaign Manager, create an Iterable-specific API key:
-
In your Application, click Settings > Integration API Keys.
-
Click Create API Key.
-
In the Create API Key drawer, select Production as the key type.
-
In Key name, type a name to identify the key.
-
In Key expiration date, select a date.
-
In Third-party integration, select Yes.
-
From Platform, select Iterable.
-
Click Create API Key.
-
Click to copy the key for use.
noteYou cannot view or copy the API key after closing the drawer. If you lose it, create another API key.
Creating a data feed in Iterable
To get the loyalty information of a given customer in Iterable, we call the following endpoint:
https://integration.talon.one/iterable/loyalty
See API Docs
To access this endpoint, create a data feed in Iterable:
- In Iterable, open Content > Data feeds.
- Click New data feed.
- In Name, enter a name for the feed.
- In URL, enter the URL of the Talon.One endpoint including parameters. To generate the URL, use the form below.
- Set Format to
JSON
. - In Authorization token, type
ApiKey-v1 YOUR_API_KEY
, whereYOUR_API_KEY
is the API key you created.
Generating the URL
Generate the URL for the data feed with the following form.
You can use Iterable field values, for example {{userid}}
or {{email}}
.
Creating a template in Iterable
To send the loyalty information, let's create an email template in Iterable:
-
In Iterable, open Content > Templates.
-
Click New Template > Email.
-
Enter a name and click Create template.
-
In Details, click Edit details and make the following settings:
- Enter a subject for the email.
- Select Connect data feeds for dynamic template creation and choose the data feed you created.
-
In Design, click Edit design. When asked, choose the WYSIWYG editor.
-
Use the following example to create your email template:
Hi {{firstName}},
Thank you for participating in our loyalty program. Your current balance is: [[ledger.currentBalance]].
To unsubscribe from these emails, click {{unsubscribeUrl}}.
You can now use this template in a campaign to send loyalty information to your customers.
In the example above, we use the following syntax:
- Double curly braces
{{...}}
for user profile data and merge parameters. - Double square brackets
[[...]]
for data feed data.
When the campaign is triggered and the email template is sent, these placeholders are populated with values from Iterable and Talon.One.
Testing the connection
Let's test our setup using the Preview feature in Iterable.
To test the connection:
- In Iterable, open the template you created.
- Click Preview.
- In User data, enter the email address of an existing user and click Load user data.
The user's data appears. - In Data feeds, click Load data feeds.
- Check whether the correct loyalty balance is shown in the template preview.