Creating coupons via Bloomreach Engagement
In this tutorial, let's set up Bloomreach Engagement to generate coupon codes in Talon.One and deliver them to your customers via email.
Talon.One requirements
- You are an Admin user.
- You have set up an Application.
- Your Application contains a running campaign with the Coupons feature enabled.
Bloomreach requirements
- You have set up an email provider.
- You have set up a consent category.
A good understanding of email marketing can help you tailor your scenarios effectively. We highly recommend you read the Bloomreach documentation first.
Creating an Integration API key
An Integration API key allows authentication for incoming webhook requests. In Talon.One, let's create an API key to aid authentication in a later step.
To create an 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 Customer Engagement Platform.
-
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.
Configuring webhook authentication
In Bloomreach Engagement, let's configure the webhook authentication for Talon.One so that data can be passed securely in the webhook request. We will use this webhook authentication while creating a scenario in a later step.
To configure the webhook authentication:
-
In Bloomreach Engagement, open Data & Assets > Integrations.
-
Click Add new integration.
-
Click HTTP Authentication Schemas.
-
In Endpoint, type the following endpoint URL:
See API DocsGET Create couponhttps://integration.talon.one/customer_engagement/coupon
-
Click Custom headers, and enter the following headers:
Key Value Type Authorization
ApiKey-v1 YOUR_API_KEY
, whereYOUR_API_KEY
is the API key you created.public destination-hostname
The base URL of your Talon.One deployment, for example, mycompany.europe-west1.talon.one
.public customer-engagement-platform-name
BloomreachEngagement
public -
At the top-left of the page, click the name of the integration to rename it appropriately.
-
Click Save integration.
Creating a scenario
In Bloomreach Engagement, let's create a scenario to create a coupon code in Talon.One and use it in an email.
For this tutorial, we'll create a simple demo scenario that sends an email one minute after you start the scenario. To do so:
- In Bloomreach Engagement, open Campaigns > Scenarios > New Scenario.
- (Optional) At the top-left of the page, click the name of the scenario to rename it appropriately.
- Add a Now trigger and a Wait operator and connect them.
- Double-click the Wait operator and set Specific time period to
1
minutes. - Add a Webhook action and connect it to the Wait operator.
- Double-click the Webhook action and configure the following parameters:
- In the Editor tab:
-
Click the POST dropdown and change it to GET.
-
Enter the following URL:
https:/customer_engagement/coupon?applicationId=YOUR_APPLICATION_ID&campaignId=YOUR_CAMPAIGN_ID&externalCampaignId={{ scenario.name }}
YOUR_APPLICATION_ID
is the ID of your Application in Talon.One.YOUR_CAMPAIGN_ID
is the ID of your campaign in Talon.One.
tipTo see the Application ID and campaign ID, open your Talon.One campaign and check the URL in your browser.
For example, if the URL ishttps://mycompany.europe-west1.talon.one/applications/198/campaigns/373
, the Application ID is198
, and the campaign ID is373
. -
Click the Do not process response dropdown and change it to Process response as JSON.
-
- In the Settings tab:
- Enable Authentication and select the webhook authentication you created.
- In Other, select the required consent category for your customers.
- Click Done.
- In the Editor tab:
- Add an Email action and connect it to the Webhook action.
- Double-click the Email action, click HTML builder, and configure the following parameters:
-
In the Editor tab:
-
In Subject line, enter the title of the email.
-
Add the following HTML code:
<html>
<head><meta charset="utf-8" /></head>
<body>
<p>Your coupon code: {{ webhook.Value }}</p>
</body>
</html>
-
-
In the Settings tab:
- In Recipients, choose Customers matching campaign if you already set up a campaign, or Set recipient manually to test the scenario with a single recipient.
- In Consent category, select the required consent category for your customers.
-
Click Done.
-
- Click Save.
The scenario should now look like this:
You can also create a webhook preset, which is a reusable webhook template that you can use in your Bloomreach Engagement scenarios.
Running the scenario
Before you run the scenario you created, you can test and preview the complete workflow in the Test tab.
To run the scenario, click Start. You will see a confirmation window indicating how many customers will be affected by the scenario run.
After one minute, an email will be sent to the configured recipients, containing the text Your coupon code:
,
followed by the coupon code generated in Talon.One.