You can attach the following file types to your transactional sends:
- JPEG
- PNG
This means you can send files such as invoices, return labels, order summary, scannable QR codes, etc.
To do this, call the Transactional API adding attachments
as a list.
Considerations
You must encode your file in base64.
Be aware that if only one of your files fails, the entire call will fail.
-
The file extension must be one of these:
- .png
- .jpeg
- .jpg
- Maximum of 10 files per message.
- Maximum file size: 10MB total attachment size
- All attachments should be saved with different names.
Data set
Value |
Description |
Examples |
|
The attachment's file name |
order_confirmation.pdf |
|
The type of file you're sending. |
Note: You can attach .jpeg or .jpg files, but the type must always be image/jpeg.
|
|
The import base64 string. |
Q29uZ3JhdHVsYXRpb25zLCB5b3UgY2FuIGJhc2U2NCBkZWNvZGUh |
Example payload: PDF
Here's an example payload for adding PDF attachments to transactional sends:
{
"subject": "Test!",
"to": {
"name": "Destination",
"email": "destination@ometria.com"
},
"from": {
"name": "Tester",
"email": "test@ometria.email"
},
"transactional": true,
"stream": "default",
"content": {
"html": "Hello this is a test. Param value is {{ var1 }}.",
"text": "Hello this is a test"
},
"sandbox": false,
"data": {
"var1": "true"
},
"attachments": [
{
"name": "something.pdf",
"type": "application/pdf",
"data": "Q29uZ3JhdHVsYXRpb25zLCB5b3UgY2FuIGJhc2U2NCBkZWNvZGUh"
},{
"name": "something.jpg",
"type": "image/jpeg",
"data": "Q29uZ3JhdHVsYXRpb25zLCB5b3UgY2FuIGJhc2U2NCBkZWNvZGUh"
},{
"name": "something.png",
"type": "image/png",
"data": "Q29uZ3JhdHVsYXRpb25zLCB5b3UgY2FuIGJhc2U2NCBkZWNvZGUh"
}
]
Comments
0 comments
Article is closed for comments.