Braze

Voucherify and Braze integration

Braze integration enables you to send codes with your Braze account. In this tutorial, we are going to show you how to send unique coupons, gift cards, loyalty, and referral codes to your Braze users. Voucherify enables you to use Braze's Connected Content, Braze's Custom Attributes, or Braze's Promo Codes Snippet to push codes from Voucherify to Braze. 

Before you start

When scheduling distributions with Voucherify and Braze, keep in mind your hourly API calls limit. Braze supports Rate-Limiting and Frequency Capping to control the number of messages delivered to your customers in a particular timeframe. Please note that exceeding your hourly API calls limit blocks your access to Voucherify API and may break the distribution.

We highly recommend setting up Delivery Speed Rate-Limiting to 250 messages per minute to ensure seamless workflow between Voucherify and Braze APIs. Go here to see the detailed instructions.

Contents

  1. Connected Content
  2. Custom Attributes
  3. Promotion Codes List
  4. Annotated emails powered by Google

Send Codes using Connected Content

Add unique codes to Braze Campaigns via Braze’s Connected Content. You can use unique discount coupons, gift cards campaigns, loyalty cards and referral codes. 

Go to your Braze Account and create a new campaign.

Define your campaign name, choose a message template, and edit the message body to add {% connected_content %} tag with code publication settings. In the following example, we're going to use connected content in the Braze email campaign. 

Edit the email body: 

Here's a code snippet that you need to add to the template (put the snippet under the <body> tag):

{% assign campaign_id = {{campaign.${api_id}}} %}
{% assign customer_id = {{${user_id}}} %}
{% assign source_id = campaign_id | append: customer_id %}

{% connected_content 
	https://api.voucherify.io/v1/publications
        :method post
        :headers {
        	"X-App-Id": "VOUCHERIFY-APP-ID",
                "X-App-Token": "VOUCHERIFY-APP-TOKEN"
        }
        :body campaign=CAMPAIGN_ID&customer={{${user_id}}}&channel=Braze&source_id={{source_id}}
        :content_type application/json
        :save publication
 %}

After you copy the code to the message body, add your API keys and campaign id as described below

  1. Add VOUCHERIFY-APP-ID and VOUCHERIFY-APP-TOKEN from your Project Settings (section Application Keys).
  2. Replace CAMPAIGN_ID which is a unique identifier of your Voucherify campaign, you can find the campaign id in the URL while displaying campaign details in the dashboard.

Unique publication per customer

The {{source_id}} parameter in the email body provides that each customer can receive only one unique code in a single Braze email campaign. As a result, even if the Braze unintentionally multiplies request, each user will receive the same unique code that was published to him/her in the first message. If you'd like to change this effect, go here to see other {{source_id}} configurations.

Customer can join only once

If your Voucherify campaign has a limit Customers can join only once, you don't need to set a unique source id in connected content as Voucherify will make sure that each Braze message to the same customer will deliver the same code that was published at the first place. Your connected content snipped should be as follows:

{% connected_content 
	https://api.voucherify.io/v1/publications
        :method post
        :headers {
        	"X-App-Id": "VOUCHERIFY-APP-ID",
                "X-App-Token": "VOUCHERIFY-APP-TOKEN"
        }
        :body campaign=CAMPAIGN_ID&customer={{${user_id}}}&channel=Braze
        :content_type application/json
        :save publication
 %}

Lastly, you need to add the following code to the body to display the published voucher code (it should be visible in the preview):

{{publication.voucher.code}}

Example setup of the email body with connected content:

As a result, each customer gets an email with a unique code automatically assigned to their profile

Each time a code gets to the user, it is published to his/her profile in Voucherify. 

We highly advise you not to wholly depend on the 'Preview mode' and to send several test messages to confirm that everything works as it should. 

Important

  • When testing the email template be aware of the Connected Content cache (at least 5 minutes). If you want each test preview to publish a new voucher, you can omit the cache by appending a query parameter to the URL, e.g. ?t=1, and increment the number with each test.
  • X-Voucherify-API-Version (optional) – if your project uses the API Version older than v2017-04-20, then you should use a slightly different syntax :save voucher instead of :save publication and to display the code type {{voucher.code}}.
  • While setting up publication source_id you can differentiate your users by using two different variables: ${user_id} which is an external id (seen as source id in a customer profile in Voucherify) and ${braze_id} which is an internal id.
  • You can modify {{source_id}} bu using the following configurations: 
    • {{campaign.${dispatch_id}}} – ensures that all customers within a single send-out will use the same publication.
    • {{campaign.${api_id}}} – ensures that all customers within a single campaign will use the same publication.
    • {{${user_id}}} / {{${braze_id}}} – ensures that every customer will use the same publication no matter which campaign is sent (you can use ${user_id} which is an external id and ${braze_id} which is an internal id).
    • {{campaign.${dispatch_id}}} + {{campaign.${user_id}}} – each customer within single send-out will use the same unique publication.

Send Codes using Custom Attributes

Braze Custom Attributes enable you to assign Voucherify codes to custom attributes in user profiles in Braze. You can use unique coupons, gift cards, loyalty cards and referral codes.

First, connect your Voucherify account with Braze: 

  1. Copy the REST API Key from your Braze account (it should have a permission 'users.track' at least)

  2. Go to the Integrations Directory in your Voucherify dashboard, find Braze and choose Connect.

 Put the copied API Key and choose Connect:


When connected, you can start a new Voucherify distribution that assigns code to the custom attribute in the user profile in Braze. Later on, you can use received attributes with codes in your Braze campaigns.

Please note that before setting up distribution, you need to add your Braze users to the Voucherify dashboard. Go here to read more.

You can distribute codes to Braze using manual mode or define an automated workflow that triggers code delivery in response to action taken by your users.

In both manual and automatic mode, Voucherify sends unique codes with their attributes and assigns them to Custom Attributes in users' profiles. 

Manual distribution 

Manual mode works as a one-time action that assigns codes to a chosen audience.  Run the Distribution Manager with the Plus and choose Manual Message.

Name your distribution.

Select a segment of users or a single customer as your receivers (1) and choose a campaign that will be a source of unique codes (2). 

Go to the Next step to add marketing permissions. If you don't collect permissions from your audience, disable the consents verification.

In the Next step, choose Braze as a channel and map custom fields that will be added to the user profile in Braze. You need to add the field representing code of published voucher, the rest of the fields are optional.

Choose Next step to see a summary of the distribution. Click Save and send to deliver codes to user profiles in Braze. 

Automatic workflow

Voucherify can push out codes to Braze automatically in response to the following triggers:

  • Customer entered/left specific Voucherify segment
  • Successful code publish – the message is sent once the code from a campaign is published (assigned) to a customer in Voucherify. 
  • Order status changed (order created, order update, order has been paid, order canceled)
  • Gift credits added – the message is sent once gift card credits are added to the customer's card. 
  • Loyalty points added – the message is sent once loyalty points are added to the customer's profile.
  • Voucher redeemed – the message is sent to customers who successfully redeemed vouchers.
  • Voucher redemption rollback – the message is sent to the customer whose redemption was successfully rolled back. 
  • Reward redemption – the message is sent when a customer redeems a loyalty or referral reward.

To set up an automatic workflow with Braze and Voucherify, visit our step-by-step tutorial.

When the custom attribute with code is added, you can use it in your Braze campaigns.       

Edit your email body and add the custom attribute defined in the Voucherify distribution. Place {{custom_attribute.${custom_attribute_with_code}}} to display the unique code.

When it's ready, you can see the code in your message preview.


Send Codes Using Braze Promo Codes List

Next to the Connected Content and Custom Attributes, you can share Voucherify codes using Braze Promo Codes snippet. 

Step 1: Export Unique Codes from Voucherify Campaign.

Edit the CSV file and remove the name of the column to leave the list of codes only. 

Step 2: Create a Promotion Codes List in Braze. 

Go to the Promotion Codes in the Braze Integrations section and click Create Promotion Code List. 

You can use the Voucherify campaign name to name the list and ensure data consistency. 

Besides the name, add the code snippet that refers to the codes from the list, it will be populated with a unique code once the message is sent. 

You can set attributes for codes such as List Expiration and Threshold Alerts, however, note that Voucherify manages logic behind your codes regardless of list settings. 

Upload the CSV file with Voucherify codes.

When the import is done, click Save to confirm the list details.

Step 3: Use Code Snippet in Braze Campaign

To use codes from the list in a Braze campaign, Copy Snippet and add it to the email body.

Add the code snippet to display a code from the list.

Once the message with code is sent, the same code won’t be used ever again. 

If you need help on any of the steps above, visit this detailed Promo Codes User Guide.


Email annotations powered by Google

Braze supports the promotional annotations of emails. You can use email markup to add key data to your emails such as promo codes, expiration dates, discount values, and more. The information included in the annotation will appear at the top of an email, right next to the subject line and sender credentials.

Email annotation

Google offers several types of data to be included in your email annotation. Go here for further reference.

Data types include the logo (ImageObject or URL), an image representing the discount (ImageObject or URL) and email subject line (text).

As far as vouchers are concerned you can use four fields:

Name Type Description
description Text The text on the promotion strip ("20% off + free shipping in the image above) - added manually
discountCode Text The discount code - {{publication.voucher.code}} in Voucherfiy
availabilityStarts DateTime The start date of your offer - {{publication.voucher.start_date}} in Voucherify
availabilityEnds DateTime The expiry date of your offer - {{publication.voucher.expiration_date}} in Voucherify

All these properties should be included in the header of your email message as JSON-LD.

Go here to learn how to optimize your promo annotations in Braze.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us