Attachments
Attachments have arrived on Waypoint.
Attachments have been one of our most requested features. After months of beta testing, we’re excited to make them generally available to all Waypoint customers.
You can now send emails with two types of attachments:
- Standard attachments – Files included with an email but not shown in the message body (for example, PDFs or spreadsheets).
- Inline attachments – Files, usually images, that are embedded directly within the email content.
Both types are added by including an attachments
object in your API request. Example below:
const axios = require('axios');const fs = require('fs');
// Read and encode the file to base64const filePath = './order-receipt.pdf';const fileContent = fs.readFileSync(filePath);const base64Content = fileContent.toString('base64');
// Send the email with attachmentaxios({ method: "post", url: "https://live.waypointapi.com/v1/email_messages", headers: { "Content-Type": "application/json" }, auth: { username: API_KEY_USERNAME, password: API_KEY_PASSWORD }, data: { "templateId": "wptemplate_ABc123XYZ", "to": "jordan@usewaypoint.com", "variables": { "user": { "displayName": "Jordan", }, "product": { "title": "Beechers Mac & Cheese", "id": "02934203942" } }, "attachments": [ { "name": `order-receipt.pdf`, "contentBlob": base64Content, "contentType": 'application/pdf', }, ], }}).then(function (response) { console.log(response);}).catch(function (error) { console.log(error);})
Additionally, within your activity, messages sent with one or many attachments, will show the attachment name underneath the message preview.