Braze Tutorial: How To Send Emails With Attachments

Can you send emails with attachments in Braze?
Yes!
Is it a little bit tricky?
Yes!
Will this tutorial cover everything you need to know?
Yes!
🗣️ WATCH FULL YOUTUBE VIDEO HERE 🗣
What’s up everyone, my name is Allan, Founder and Consultant at For Now Marketing, and welcome back to our channel!
Before we get started, if you have any questions, whether you are currently using Braze or considering using Braze, please feel free to reach out! You can find these addresses and more in the Youtube description below.
Today, we are going to talk through How To Send Emails With Attachments in Braze.
Let’s get started!
API-Only Campaign
Before we get started, there’s one feature we need to talk about.
Most of us are used to working with Braze email campaigns that are actually built inside the dashboard.
Well, of course the email campaign is built inside the dashboard, what are you talking about?
There is a feature called API-Only Campaign which allows Braze users to send messages from your dashboard, strictly through the API, without ever having to create a campaign. And it is only through the API-Only Campaign that we are able to send emails with attachments in Braze.
Most of the times, it would be best to go through your Engineering team to launch this email campaign with an attachment; however, we’ll walk through what the process looks like using Braze webhooks. You can also send this video to your Engineering team to be used as a guide, if they choose to launch it outside of Braze!
/messages/send API Endpoint
First, let’s create an API Key which we will use later in our setup. Navigate to Settings → APIs and Identifiers, Create New API Key, and enable “messages.send”.

Webhook Setup
Next, let’s create a Webhook Campaign, and fill in the following information:
Webhook URL:
- https://rest.iad-01.braze.com/messages/send
- https://rest.iad-02.braze.com/messages/send
- https://rest.iad-03.braze.com/messages/send
- https://rest.iad-04.braze.com/messages/send
- https://rest.iad-05.braze.com/messages/send
- https://rest.iad-06.braze.com/messages/send
- https://rest.iad-07.braze.com/messages/send
- https://rest.iad-08.braze.com/messages/send
- https://rest.fra-01.braze.eu/messages/send
- https://rest.fra-02.braze.eu/messages/send

Settings:
Next, navigate to the Settings page, click “Add New Pair” twice, and fill in the Request Headers.

- content-type: application/json
- Authorization: Bearer YOUR-API-KEY
Request Body and Email Object
Finally, we’re going to go back to the “Compose” tab, and copy and paste the code snippet below.
Request Body:
{
"external_user_ids": ["YOUR_EXTERNAL_ID"],
"messages":{
"email":{
"app_id":"YOUR_APP_ID",
"subject" : "This is my subject",
"body": "This is my body",
"from": "NEWS <news@demo01.braze.com>",
"attachments":[{
"file_name":"Sample Dummy PDF File",
"url":"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
}]
}
}
}
Let’s go over a few of these fields together. We’re mainly working through the “email object”.
First of all, I’m personally going to hardcode my external_id as I’ll only be sending a single test email to my own user profile. However, if you do plan on launching this to a wider audience, then be sure to make this external_id dynamic to the recipient.
Next, the app_id can be a bit confusing and hard to find, but navigate to Settings → APIs and Identifiers, and you can use any one of the Identifiers found under the “Identification” and “App Name” section. Yes, it doesn’t matter which one you use, as long as you use one app_id that is associated with your dashboard.
The from field has to follow this exact format: “Display Name <from email address>”.
And lastly, the attachments object has two fields:
- file_name which will not include the extension, so do not put “.pdf” in this field
- url to access the attachment, which means that your attachment does need to be hosted somewhere and be accessible via a url.
Thank You!
That’s it for today!
As always, if you have any questions, please share them in the comments. We’re happy to help! 🙏
If you learned something from this video, please subscribe for more awesome Braze videos in the future!
Thank you for watching, and see you next time!
allan@fornowmarketing.com
fornowmarketing.com