Sending without a template
If you want to send fully-ready HTML (or plain text) emails without using Waypoint’s dynamic templates, you can do so by passing in HTML and/or plain text to the API call. This can be especially useful if you are migrating from another service that does not support dynamic templates.
The API call is the same as the one used for sending with a template API except you’ll pass in a bodyHtml
and/or bodyText
instead of referencing a templateId
and variables
.
API endpoints
Section titled “API endpoints”Code example
Section titled “Code example”const axios = require('axios');
axios({ 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: { "to": "jordan@usewaypoint.com", "from": "support@usewaypoint.com", "subject": "Email without a template example", "bodyHtml": "<p>This is an email template without a template</p>" }}).then(function (response) { console.log(response);}).catch(function (error) { console.log(error);})
curl "https://live.waypointapi.com/v1/email_messages" \ -H "Content-Type: application/json" \ -u "API_KEY_USERNAME:API_KEY_PASSWORD" \ -d '{ "to": "jordan@usewaypoint.com", "from": "support@usewaypoint.com", "subject": "Email without a template example", "bodyHtml": "<p>This is an email template without a template</p>"}'