Braze

Voucherify and Braze integration

Voucherify <> Braze integration enables you to send vouchers with your Braze account. In this tutorial, we are going to show you two available modes of integration.

Useful links:


This section talks about:

  1. Publish voucher via Braze's Connected Content
  2. Publish voucher via Braze's Custom Attributes
  3. Annotated emails powered by Google

Publish voucher via Connected Content 📱

You can publish a voucher and include it in the email using Braze’s Connected Content. 

Go to your Braze Account and create a new campaign.

Braze Connected Content

Define your campaign name, choose an email template, and edit the email body do add {% connected_content %} tag. You can publish a voucher and include it in the email using Braze’s Connected Content.

Edit the email body:

Braze email body edition

Here is a code snippet that you need to add to the email template:

{% assign campaign_name="New Year Sale" %}
{% 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_name}}&customer={{${user_id}}}&channel=Braze
     :content_type application/json
     :save publication
%}

To display the published voucher code:

{{publication.voucher.code}}

When you click on Preview and Test, you should see a random code from your campaign. You can define your text message, as well. Here is an example of a code added to the template.

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. 

Braze ready code

Note 💡

  • Assigning the campaign_name variable is a workaround to pass campaign names which include spaces. Alternatively, you can pass a campaign id directly in the :body.
  • ${user_id} is the external_id of the user in Braze and will be set as source_id for the customer in Voucherify.
  • When testing the email template be aware of 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}}

Publish via Custom Attributes ❓

Another way of assigning particular codes to customers and receiving Voucherify customer and code attributes is via releasing a Distribution. 

To start with, connect your Voucherify account with Braze. Copy the REST API Key from your Braze account (it should have a permission 'users.track' at least)

Copying Braze API Key

Go to the Integrations Directory in your Voucherify dashboard and put the copied Key:


When connected, you can use the plus to start a new Braze distribution in the dashboard that is not going to send any messages but would rather work as a method of assigning particular code to a customer and receiving custom attributes that will be automatically transferred to your Braze account to be used in your Braze campaigns

Keep in mind that Braze Connected Content functionality will suffice for publishing referral codes to customers as Braze will connect with Voucherify and collect needed data automatically. 

In the manager, go through the first 6 stages to set distribution details:

1

Choose between a manual and automatic mode.

Manual or automatic mode

If you want to automate your Braze campaign to assign codes and receive custom attributes each time a customer meets the audience criteria, go with the Auto Messages. However, if you want to launch a specific campaign and codes once to a predefined audience, select Manual Mode

2

Define distribution purposes. 

As we want to assign codes to a customer, go with 'Send unique codes from a campaign'. Keep in mind that Voucherify is not going to send any messages as the codes are going to be assigned to customers and custom attributes (customer id, voucher code) are going to be transferred to the Braze account that you've integrated with Voucherify in the previous step. 

3

Define your audience:

  • choose a single customer (manual mode)
  • pick one of your existing segments or define a new one from scratch (automatic mode)
  • segment your audience based on marketing permissions

Choosing audience based on segmentChoosing audience based on marketing permissions

4

In the 4th stage, add a message subject which is going to act only as an identifier for Voucherify, not an actual email subject which you will choose later on when launching an email campaign in Braze.

Title your message

5

Lastly, choose a Braze as a channel and define a custom attribute name - you will use that property for putting a code in the Braze message.

Braze as a distribution channel

When it's ready, choose to  SEND to test your distribution - as a result, you should get a user with text and QR/barcode assigned.

Note 💡

What’s important to notice is that sending messages via Braze acts more like assigning a code to a particular customer - after sending the message via Braze, you should go to your Braze account and create a new email campaign that is going to use custom attributes defined in Voucherify Distribution, that is Voucherify codes.


Let us come back to Braze. 
 

VoucherifyCode attribute in Braze

To find the user in Braze, use UserID (source_id) from a Voucherify customer profile.

Customer source id

and type it into the following view in Braze:

Searching for a customer

To send an email from Braze with embedded code, you have to define a Braze campaign:

1

Choose `Campaigns`

2

Click `Create Campaign`,

Braze - create a new email campaign

3

Select `Email`, 

4

Choose `Blank Template`, 

5

Go to `Edit Email Body`, 

6

Switch to  `Body` tab 

7

Customize your template and add `Custom Attributes` defined in the Voucherify distribution.

Add custom Voucherify attribute

8

When it's ready, you can see your message in `Preview`.

Message preview

To leave the editor, confirm your template with DONE and choose FORWARD to finish campaign settings. That's it! 🥳

New feature - Email annotations powered by Google

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

Still need help? Contact Us Contact Us