Skip to main content

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 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.

campaign id location

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 an API Key in Iterable#

  1. Click Integrations > API Keys > NEW API KEY.
  2. 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 on Talon.One#

Let's create the Talon.One webhook that triggers the Iterable email:

  1. Open the Campaign Manager and in the bottom-left corner click Account > Dev Tools > Webhooks and click Create Webhook.
  2. Give the Webhook a memorable name like Send Iterable Email, and select the Application(s) in which it should be available.
  3. Check Display in Rule Builder so the webhook is accessible as an Effect in Rule Builder.

Adding parameters#

Add parameters for any webhook-specific data you'll need to pass to Iterable. In our case, let's image we want to pass a coupon code so we create the following parameter:

  • type: string
  • param title: couponCode

Creating the request#

  1. Set Request Verb to POST.
  2. 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 replace myapikey by the value you generated earlier.

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.

  1. Let's use the campaignId field to store the campaignId found in the first step.

  2. The email address and name of the addressee are retrieved from the Talon.One customer profile.

    note

    We assume emails and names are synced with Talon.One.

  3. The coupon code is dynamically generated by Talon.One.

note

Your 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}"    }}

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.

  1. In the Campaign Manager, open your campaign and the Rule Builder.
  2. 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.

webhook setup

Every time the rule is valid, it will trigger Iterable to send an email to the current customer.