Enveloop Docs
Sign up for Enveloop!
  • Enveloop Docs
  • Overview
    • ✨Features
  • Getting Started
    • Introduction to Enveloop
    • Creating a Template
    • Formatting / Dynamic Content
    • Sending a test message
    • Adding a Sending Domain
    • Deploying your first message
  • Product Guides
    • Elements
      • 🔋Table
    • Using Shared Sections
    • Markdown for Formatting
    • Mustache for Dynamic Content
    • Creating a Verified Sender
    • Logging
    • Monitoring
    • Webhooks
    • Themes
  • Integrations
    • Do I need integrations?
    • SMS Integrations
      • Twilio
      • TextGrid
    • Email Integrations
      • SendGrid
      • Postmark
      • Mailgun
      • Amazon SES
      • SMTP
        • ✉️Amazon SES
        • ✉️Gmail SMTP
        • ✉️Google Domain SMTP Relay
    • Partner Integrations
      • Fly.io
  • Enveloop API
    • Getting Started with Enveloop API
    • Core API Endpoints
      • Connecting to the Enveloop API
      • POST /messages
      • GET /templates/:slug
    • Languages and Frameworks
      • 🟢NodeJS
      • 🏮Ruby on Rails
      • 🟡Python
      • 🏮Ruby
  • Settings
    • Sending IPs
  • Company
    • About Us
    • 👩‍⚖️Terms of Service
    • 😎Privacy Policy
Powered by GitBook
On this page
  • Install the Enveloop node package
  • Send Messages
  1. Enveloop API
  2. Languages and Frameworks

NodeJS

Send messages on Enveloop by using the node SDK

Install the Enveloop node package

yarn

yarn add enveloop

npm

npm install --save enveloop

Send Messages

const Enveloop = require("enveloop")
const enveloop = new Enveloop({ apiKey: "test_eYLQRrzxLcLAlmb2H5BXIFSUor3h/tRr" })

enveloop.sendMessage({
  template: "user-welcome",
  to: "leslie@knope.com",
  from: "Chris Traeger <chris@pawnee.parksandrec.gov>",
  subject: "Welcome to Pawnee",
  templateVariables: {
    name: "Leslie Knope"
  }
})
.then(res => console.log(res))
.catch(err => console.log(err))

Last updated 1 year ago

🟢