Skip to main content

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:

  1. On the user's birthday, Talon.One generates a coupon code and passes it to Braze through the webhook effect.
  2. Braze displays the received coupon code in a placeholder inside a personalized message to the user.
  3. 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:

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

  2. Create a Braze campaign to send the coupon code to the user.

  3. Create a Talon.One campaign to pass a generated coupon to Braze.

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

  • You know which messaging channels you wish to use to reach your user.
  • You 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.

tip

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:

  1. Open Account > Integrations > Braze.
  2. Click Create Webhook > Send personalized coupon.
  3. In Webhook title, type a name for your webhook.
    • In this tutorial, we name it Send coupon code to Braze.
  4. In Applications, select the Applications in which the webhook must be available.
  5. (Optional) Review the payload.
  6. Copy the reference to the triggered property for later use in Braze.
  7. 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:

  1. In Braze, click Messaging > Campaigns > Create Campaign > Multichannel Campaign.
  2. In Campaign Name, type a name for your campaign.
  3. Click Add Messaging Channel, and select your desired channel.
    • In this tutorial, we select Email.
  4. 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}}}.
      tip

      To learn about composing the email body, see the Braze docs.

  5. In the Schedule Delivery tab, select API-Triggered as the delivery type.
  6. In the API Trigger Options section, copy the campaign ID for later use.
  7. In the Target Audiences tab, ensure that the targeted segment includes the email address of the user you want to send the coupon to.
  8. 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 1 condition and 2 effects:

Condition

  • Check attribute value: Customer Birthday (Customer Profile) is on month day Current time.

Effects

  1. 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.
  2. Send coupon code to Braze: campaign_id is <Campaign ID>, external_user_id is <External User ID>, and coupon is Generated Coupon in Session.

    note

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