Skip to content

Commit

Permalink
[documentation] Updating README with correct renderToStaticMarkup fun…
Browse files Browse the repository at this point in the history
…ction (#89)
  • Loading branch information
jordanisip authored Apr 17, 2024
1 parent 841f8e7 commit 0ffa4af
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ const CONFIGURATION: TReaderDocument = {
You can render the EmailBuilder.js configuration to an HTML email string:

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

const string = renderHtmlDocument(CONFIGURATION, 'root');
const string = renderToStaticMarkup(CONFIGURATION, { rootBlockId: 'root' });
```

Or you can render the EmailBuilder.js configuration by using the `<Reader />` React component:
Expand All @@ -148,7 +148,7 @@ In most cases, you'll want to take the EmailBuilder.js configuration, render it
### Sending through nodemailer

```javascript
import { renderHtmlDocument } from '@usewaypoint/email-builder';
import { renderToStaticMarkup } from '@usewaypoint/email-builder';
import nodemailer from "nodemailer";

// Replace this with your transport configuration
Expand All @@ -162,7 +162,7 @@ await transporter.sendMail({
from: 'no-reply@example.com'
to: 'friend@example.com',
subject: 'Hello',
html: renderHtmlDocument(CONFIGURATION, 'root'),
html: renderToStaticMarkup(CONFIGURATION, { rootBlockId: 'root' }),
});
```

Expand All @@ -175,7 +175,7 @@ We'll use [Waypoint](https://www.usewaypoint.com) for this example, however, you
```javascript
import axios from 'axios';

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

// Replace this with the JSON for your Reader document
const CONFIGURATION: TReaderDocument = {}
Expand All @@ -195,7 +195,7 @@ await axios({
from: 'no-reply@example.com'
to: 'friend@example.com',
subject: 'Hello',
bodyHtml: renderHtmlDocument(CONFIGURATION, 'root'),
bodyHtml: renderToStaticMarkup(CONFIGURATION, { rootBlockId: 'root' }),
},
});
```
Expand Down

0 comments on commit 0ffa4af

Please sign in to comment.