Creating referral codes via Iterable
In this tutorial, let's set up Iterable to automatically generate referral codes inside Talon.One and deliver them to customers.
Talon.One requirements
- You are an Admin user.
- You have set up an Application.
- Your Application contains a running campaign with the Referrals feature enabled.
You can edit the default format of the referral codes in the campaign's Settings > Referral Codes section.
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 generate the referral code in Iterable, we call the following endpoint:
https://integration.talon.one/iterable/referral
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 generate and send the referral code, 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 referral program. Your referral code is: [[code]]
To unsubscribe from these emails, click {{unsubscribeUrl}}.
You can now use this template in a campaign. For each email sent, a referral code is generated in Talon.One and displayed in the email.
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 a referral code is shown in the template preview.
- Check whether the referral code has been added to your campaign in Talon.One.