Skip to content

A free and open-source block-based email template builder.

Adding nodemailer sample (#69)

cohitre7d619be87fd5
diff --git a/README.md b/README.md
index 93f920c..f0f75ae 100644
--- a/README.md
+++ b/README.md
@@ -147,7 +147,24 @@ In most cases, you'll want to take the EmailBuilder.js configuration, render it
### Sending through nodemailer
-Coming soon
+```javascript
+import { renderHtmlDocument } from '@usewaypoint/email-builder';
+import nodemailer from "nodemailer";
+
+// Replace this with your transport configuration
+const transportConfig = {}
+const transporter = nodemailer.createTransport(transportConfig);
+
+// Replace this with the JSON for your Reader document
+const CONFIGURATION: TReaderDocument = {}
+
+await transporter.sendMail({
+ subject: 'Hello',
+ html: renderHtmlDocument(CONFIGURATION, 'root'),
+});
+```
<br>
@@ -175,6 +192,7 @@ await axios({
},
data: {
subject: 'Hello',
bodyHtml: renderHtmlDocument(CONFIGURATION, 'root'),