Overview
This guide will show you how to automate sending physical letters via Stannp's API using Braze’s Canvas Workflow Builder. You can trigger this action based on customer behaviors, such as new sign-ups, subscription renewals, or abandoned carts.
Prerequisites
Before you begin, ensure you have:
- A Stannp account and your API key (found under Account Settings > API Keys).
- A Braze account with access to Canvas and Webhooks.
- Complete address details in Braze user profiles to ensure correct delivery.
Step 1: Access Braze Canvas Workflow Builder
- Log in to Braze.
- Navigate to "Canvas & Campaigns" > "Canvases".
- Click "Create Canvas" and choose "Build from Scratch".
- Set a Canvas Name (e.g.,
"Send Letter via Stannp"
). - Click "Save" to proceed.
Step 2: Add a Webhook Action
- In the Canvas flow, click the "+" button at the step where you want to send a letter.
- Select "Webhook" from the list of actions.
- Click "Create New Webhook" and enter the following details:
- Request Type:
POST
- Webhook URL:
https://api-us1.stannp.com/v1/letters/create?api_key=YOUR_API_KEY
- Request Headers:
Content-Type: application/json
Step 3: Configure the Webhook Request Body
In the Request Body, use Braze personalization variables to pass customer data dynamically:
{
"recipient": {
"firstname": "{{${first_name}}}",
"lastname": "{{${last_name}}}",
"address1": "{{${address_1}}}",
"city": "{{${city}}}",
"postcode": "{{${zip_code}}}",
"country": "{{${country}}}"
},
"template": 12345,
"test": false,
"duplex": true,
"clearzone": true,
"post_unverified": true,
"tags": "braze, new_signup",
"addons": "FIRST_CLASS"
}
Key Parameters Explained:
recipient
: Uses Braze variables to map user profile data to Stannp.template
: A Stannp template ID for the letter (replace12345
with your template ID).test
: Set totrue
to generate a test letter without mailing it.duplex
:true
prints on both sides,false
prints on one side.clearzone
:true
ensures clear zones are formatted correctly for mailing.post_unverified
: Iffalse
, letters will not be sent if the address is unverified.tags
: Adds searchable tags in Stannp for reporting.addons
: Use"FIRST_CLASS"
to upgrade to first-class postage.
Step 4: Save & Activate the Canvas
- Click "Save Webhook" and return to the Canvas flow.
- Add any additional steps if needed (e.g., email or SMS follow-ups).
- Click "Launch Canvas" to activate the workflow.
Once activated, whenever a customer triggers the workflow, Braze will send the letter request to Stannp, triggering a physical letter to be mailed.
Testing & Troubleshooting
-
Test with a Sample User
- Manually trigger the workflow with a test user.
- Check your Stannp Dashboard to see if the request was received.
-
Check Braze Webhook Logs
- If letters are not being sent, navigate to Developer Console > Webhooks to inspect errors.
-
Verify API Response
- If there are errors in the logs, ensure your API key, template ID, and address data are correct.
Conclusion
By integrating Braze Canvas Workflows with Stannp, you can automate direct mail campaigns based on customer actions, ensuring a seamless omnichannel experience.