Creating a webhook to Iterable
In this tutorial, let's trigger an Iterable email as an effect in Talon.One.
For example, you can generate a coupon code for a user when certain conditions trigger and automatically email them the code via Iterable.
We will rely on the template feature in Iterable, and the webhook feature of Talon.One.
Creating a template in Iterable
To trigger an email, let's create a template used to send information to the user. Use the
{{placeholder}}
syntax to create placeholder field. It will be populated from Talon.One.
Example Email Template:
{{firstName}}, thank you for your recent purchase.
Use {{couponCode}} to get 10% off your next purchase over $20.
But hurry, the code is only active for the next 7 days.
Creating a triggered campaign in Iterable
Follow the instructions provided in the Iterable documentation.
Make note of the Campaign ID
of your campaign. The Campaign ID
in this example is
1960495
.
Creating an API Key in Iterable
- Click Integrations > API Keys > NEW API KEY.
- Name the API key and leave all of the defaults as-is and click Create. Save the key value for later use.
Creating a webhook in Talon.One
Let's create the Talon.One webhook that triggers the Iterable email:
- Open the Campaign Manager, and in the bottom-left corner, click Account > Tools > Webhooks, and click Create Webhook.
- Give the webhook a memorable name like
Send Iterable Email
, and select the Application(s) in which it should be available.
Adding parameters
Add parameters for any webhook-specific data to pass to Iterable. In our case, let's imagine we want to pass a coupon code so we create the following parameter:
Param type | Param name |
---|---|
string | couponcode |
Creating the request
- In the Request section, set Verb to
POST
. - In URL, target the relevant URL based on the transmission medium.
In this case it will be:
https://api.iterable.com/api/email/target?apiKey=myapikey
, where you can replacemyapikey
with the value you generated earlier. - In Headers, click Add to define the HTTP header using the format:
Api-Key: <API key created in Iterable>
.
Creating the payload
Let's populate the payload of the request. The body should contain the email addressee and how to populate all of the placeholders in the email template.
Let's use the
campaignId
field to store the campaignId found in the first step.The email address and name of the addressee are retrieved from the Talon.One customer profile.
noteWe assume emails and names are synced with Talon.One.
The coupon code is dynamically generated by Talon.One.
noteYour setup might vary depending on what data you want to dynamically populate in the email, but the same principles apply.
We define the following payload:
{
"campaignId": 1960495,
"recipientEmail": "${$Profile.Attributes.Email}",
"dataFields": {
"firstName": "${$Profile.Attributes.Name}",
"couponCode": "${$couponCode}"
}
}Click Create.
To learn more about how to access Talon.One attributes and include them in the webhook, see Using parameters in a webhook.
Triggering Iterable emails as an effect
Now that everything is set up, we can trigger an Iterable email via the Rule Builder.
- In the Campaign Manager, open your campaign and the Rule Builder.
- Add a new effect. In the Webhooks section, select the webhook you created earlier.
For example, here we create a coupon code for the customer and trigger a personalized Iterable email including that code.
Every time the rule is valid, it will trigger Iterable to send an email to the current customer.