The Paubox Node.js module allows you to construct and send secure, HIPAA compliant messages. This package is the official Node.js module for the Paubox Email API. The Paubox Email API allows your application to send secure, HIPAA compliant email via Paubox and track deliveries and opens.
SEE ALSO: Why Healthcare Businesses Choose the Paubox Email API
$ npm install --save paubox-node
$ echo "API_KEY='YOUR_API_KEY'" > .env $ echo "API_USERNAME='YOUR_ENDPOINT_NAME'" >> .env $ echo ".env" >> .gitignore
"use strict"; require('dotenv').config(); const pbMail = require('paubox-node'); const service = pbMail.emailService(); var options = { from: 'sender@domain.com', to: ['recipient@example.com'], subject: 'Testing!', text_content: 'Hello World!', html_content: '
', } var message = pbMail.message(options) service.sendMessage(message) .then(response => { console.log("Send Message method Response: " + JSON.stringify(response)); }).catch(error => { console.log("Error in Send Message method: " + JSON.stringify(error)); });
"use strict"; require('dotenv').config(); const pbMail = require('paubox-node'); const service = pbMail.emailService(); var options = { allowNonTLS: true, from: 'sender@domain.com', to: ['recipient@example.com'], subject: 'Testing!', text_content: 'Hello World!', html_content: '
', } var message = pbMail.message(options)
"use strict"; require('dotenv').config(); const pbMail = require('paubox-node'); const service = pbMail.emailService(); var attachmentContent = Buffer.from('Hello! This is the attachment content!').toString('base64') var options = { from: 'sender@domain.com', reply_to: 'reply_to@domain.com', to: ['recipient@example.com'], bcc: ['recipient2@example.com'], subject: 'Testing!', text_content: 'Hello World!', html_content: '
', attachments: [{ fileName: "HelloWorld.txt", contentType: "text/plain", content: attachmentContent }] } var message = pbMail.message(options)
"use strict"; require('dotenv').config(); const pbMail = require('paubox-node'); const service = pbMail.emailService(); service.getEmailDisposition("SOURCE_TRACKING_ID") .then(function (response) { console.log("Get Email Disposition method Response: " + JSON.stringify(response)); });