@usewaypoint/client
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

@usewaypoint/client

Waypoint is a platform for product teams to send, manage, and automate dynamic transactional emails – with little to no code.

This is the Node.js library to access the Waypoint API.

Sending your first email

1. Install npm package

npm install @usewaypoint/client --save

2. Import and initialize a client

import { createClient } from '@usewaypoint/client'

const client = createClient('USERNAME', 'PASSWORD');

3.1 Send a templated email message

// You can also use `client.sandboxEmailMessages.createdTemplated()`
await client.emailMessages.createTemplated({
  templateId: // template id example: 'wptemplate_xxxxxxxxxxxxxxxx',
  to: // email address of recipient,
  variables: // variables expected by the template,
});

3.2 Send a raw HTML email message

// You can also use `client.sandboxEmailMessages.createRaw()`
await client.emailMessages.createRaw({
  to: // email address of recipient,
  bodyHtml: '<h1>Hello world</h1>',
});

Development and releasing

Build a release version

npm run build npm publish

Readme

Keywords

none

Package Sidebar

Install

npm i @usewaypoint/client

Weekly Downloads

65

Version

0.0.7

License

MIT

Unpacked Size

7.67 kB

Total Files

10

Last publish

Collaborators

  • cohitre