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
  • Params
  • slug (required)
  • Response
  • templateVariables
  • body
  • error
  • Example
  • Request
  • Response
  1. Enveloop API
  2. Core API Endpoints

GET /templates/:slug

Get information about a template including the body of the template and any user defined variables that the template expects

Last updated 10 months ago

Params

slug (required)

Each template has a unique slug and this is required in the URL. This can be found, for a template, by viewing the template in Enveloop and selecting the Deploy tab for the template. The slug will be located in the the right-side drawer.

Response

templateVariables

An array of the user defined variables found in the template

body

A preview of the body of the message with {{ variables }} intact like you would see at in the Enveloop editor.

error

If an error is present you will get a http status of 500 and the error field will contain the error

Example

Request

curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: token test_eYLQRrzxLcLAlmb2H5BXIFSUor3h/tRr" \
"https://api.enveloop.com/templates/customer-invoice"

Response

{
    "templateVariables": [
        "invoiceAmount",
        "invoiceNumber"
    ],
    "body": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2//EN\"><html ... </html>"
}