Sending without a template
You can send fully-rendered HTML (or plain text) emails without using Waypoint’s dynamic templates by passing the content directly to the API. This is handy when you’re migrating from another service that doesn’t support dynamic templates.
The API call is the same as sending with a template API — just pass bodyHtml and/or bodyText instead of templateId and variables.
API endpoints
Section titled “API endpoints”Code example
Section titled “Code example”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>"}'const authHeader = 'Basic ' + Buffer.from(`${API_KEY_USERNAME}:${API_KEY_PASSWORD}`).toString('base64');
const options = { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: authHeader, }, body: JSON.stringify({ 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>', }),};
fetch('https://live.waypointapi.com/v1/email_messages', options) .then((res) => res.json()) .then((res) => console.log(res)) .catch((err) => console.error(err));