GET /templates/:slug

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

Params

slug (required)

The slug is required in the URL and can be found for a template by looking in the right drawer on the template edit.

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: 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>"
}

Last updated