Sending personalized coupons via Braze using a webhook
With a Braze integration, you can send coupon codes generated in Talon.One to specific customers through one of the available Braze messaging channels, like email, SMS, and push notification.
Tutorial summary
In this tutorial, we create a webhook to Braze using the Send personalized coupon template and set up campaigns in both platforms to show a basic integration use case. We reward a specific Braze user with a personalized message and a generated coupon code on their birthday.
When the campaigns in both platforms are successfully evaluated, we can expect the following events to happen:
- On the user's birthday, Talon.One generates a coupon code and passes it to Braze through the webhook effect.
- Braze displays the received coupon code in a placeholder inside a personalized message to the user.
- Braze sends the message to the user containing the coupon code for redemption.
Integration summary
In this tutorial, we use the following steps to show our Braze integration use case:
-
Create a webhook to Braze using the available template.
The webhook we create using the template contains a standard payload with:
- The ID of the Braze campaign.
- The ID of the Braze user to reward.
- The coupon code to reward the user with.
The template also provides a placeholder reference for the generated coupon code. In the next step, you can paste this reference directly in your message.
-
Create a Braze campaign to send the coupon code to the user.
-
Create a Talon.One campaign to pass a generated coupon to Braze.
- The Braze user interface references in this tutorial are based on the new navigation.
- This tutorial describes a single use case of a Braze integration template. You can customize your integration and campaign setups according to your business requirements.
Talon.One requirements
-
You are an Admin user.
-
In Account > Integrations > Braze, you confirmed that the Connection Details section is up to date with:
- Rest Endpoint: An endpoint URL that corresponds to your Braze instance.
- API Key: An API key generated in Braze with the required permissions.
note- To learn about finding these values in Braze, see the Braze docs.
- If you enter or modify these values, remember to click Save.
-
You have created a custom attribute to store the customer's birthday. In this tutorial, we call this attribute Customer birthday.
Braze requirements
- You know which user to reward.
- Copy the External User ID of the user to reward for later use.
tip
You can look up users by opening Audience > Search Users.
- Copy the External User ID of the user to reward for later use.
- You know which messaging channels you wish to use to reach your user.
- You have configured the required settings for those channels to work, for example, outbound email settings.
- You have an understanding of message personalization, specifically
the
trigger_properties
object. See the Braze docs.
Creating a webhook to Braze
Let's create a webhook to Braze using the Send personalized coupon template.
The template provides a reference to the triggered property that you can copy and paste directly in your Braze message in later steps. When pasted, this reference acts as a placeholder for the coupon code that is dynamically generated and sent to Braze.
In this tutorial, we use the template for convenience. You can always create a webhook without using a template.
To create a webhook to Braze:
- Open Account > Integrations > Braze.
- Click Create Webhook > Send personalized coupon.
- In Name, type a name for your webhook. In this tutorial, we name it
Send coupon code to Braze
. - In Applications, select the Applications in which the webhook must be available.
- (Optional) Review the payload.
- Copy the reference to the triggered property for later use in Braze.
- Click Save.
Creating a Braze campaign to send the coupon
In Braze, let's create a campaign to send the coupon generated in Talon.One.
To create a Braze campaign to send the coupon:
- In Braze, click Messaging > Campaigns > Create Campaign > Multichannel Campaign.
- In Campaign Name, type a name for your campaign.
- Click Add Messaging Channel, and select your desired channel. In this tutorial, we select Email.
- Compose the email body as desired.
-
To insert the dynamically generated coupon code, paste the reference to the triggered property. For example, your email message can read:
Happy birthday! Your very own coupon code is {{api_trigger_properties.${coupon}}}.
tipTo learn about composing the email body, see the Braze docs.
-
- In the Schedule Delivery tab, select API-Triggered as the delivery type.
- In the API Trigger Options section, copy the campaign ID for later use.
- In the Target Audiences tab, ensure that the targeted segment includes the email address of the user you want to send the coupon to.
- Enter the remaining required campaign details, and click Launch Campaign.
Creating a Talon.One campaign to generate the coupon
In Talon.One, let's create a standard campaign to generate a coupon code and trigger the webhook effect to pass the coupon code value to Braze.
The campaign has a single rule containing one condition and two effects:
Condition
- Check attribute value: Customer Birthday (Customer Profile) is on
month
day
Current time.
Effects
-
Create coupon code: In the current campaign, Recipient is Currect Customer (Friend), Redemption Limit is
1
.tip- To limit the discount value offered by the coupon, set a discount limit.
- To personalize your code further, select Use custom code pattern. You can add a prefix or suffix and specify the code length and character set.
-
Send coupon code to Braze: campaign_id is
<Campaign ID>
, external_user_id is<External User ID>
, and coupon is Generated Coupon in Session.noteIn this effect, you can paste the values you copied earlier:
<Campaign ID>
is the ID of your Braze campaign.<External User ID>
is the External User ID of the Braze user to reward.
Next steps
When you feel your campaign is configured to your requirements, activate the campaign. We recommend you test the integration by updating the customer profile with the customer's birthdate value.