Skip to content

Commit

Permalink
Code example
Browse files Browse the repository at this point in the history
  • Loading branch information
cohitre committed Mar 5, 2024
1 parent 7a4addc commit 9ea14da
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,32 @@ Coming soon

We'll use [Waypoint](https://www.usewaypoint.com) for this example, however, you can use any email API like Amazon SES, SendGrid, or MailGun.

<br>
```javascript
import axios from 'axios';

import { renderHtmlDocument } from '@usewaypoint/email-builder';

// Replace this with the JSON for your Reader document
const CONFIGURATION: TReaderDocument = {}

await 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: 'friend@example.com',
subject: 'Hello',
bodyHtml: renderHtmlDocument(CONFIGURATION, 'root'),
},
});
```

---

Expand Down

0 comments on commit 9ea14da

Please sign in to comment.