Prerequisites
- A Voucherify campaign with codes to publish
- A Braze campaign or Canvas
- Voucherify API credentials (App ID and App Token)
The connected content script example has additional data provided to make the script optimized.In this tutorial, only essential Voucherify data is described.Read the Optimize your Connected Content scripts for more details.
Display fetched data in Braze messages
Use the following steps to display the data fetched from Voucherify in Braze messages.Add connected content script to message template
Copy and paste the Connected Content script under the
<body> tag in a message HTML template.Connected content publication script
Set up necessary Voucherify API details
Add from Voucherify:
campaign_idcopied from the campaign details view in the Voucherify dashboard (line 4).- Your API endpoint. You can check it in Project settings > General > API endpoint (line 8).
- Add publications address
/v1/publicationsand the API method (lines 8-9). Don’t edit?cache_id={{cache_id}}. - Add your API credentials for authentication (lines 11-12).
Connected content publication script
Create snippet to display fetched data
Responses from the Voucherify API are stored by connected content under the value of This enables you to retrieve and display data from a Voucherify response in Braze messages.
:save parameter. For example, :save publication in line 18.Connected content publication script
Display fetched data in messages
To display the published code in a message template, create a snippet that fetches a unique code from the voucher object:Each customer will get a message with a unique code automatically assigned to their profile. Each time the user receives a code, it is published to their profile in Voucherify.
Set up rate limiter
When setting up a campaign target, use advanced settings to limit the number of messages sent per minute.Rate limits protect your margins during testing and live traffic. When running A/B tests or scaling campaigns, uncontrolled sending can exhaust code pools or exceed budget caps.Read more about Rate Limiter and Frequency Capping in Braze documentation.
retry attribute.
Next steps
- Optimize your Connected Content scripts — Configure caching and retry mechanisms
- Connected Content script reference — View all script templates

