Skip to content
Skip to main content
POST
/v3/grants/{grant_id}/templates/render

Render template as HTML

Renders the HTML content of a grant-level template using the provided variables and specified templating engine.

NYLAS API KEYACCESS TOKEN

Parameters

Path parameters

grant_id*string

ID of the grant to access. You can also use the email address associated with the grant, or use /me/ to refer to the grant associated with an access token.

Request body

body*string

The body content of the template, in HTML format.

Example: "<p>Hello {{user.name}}, this shows test was {{ foo }}.</p>"
engine*string

The templating engine to use.

handlebarsmustachenunjuckstwig
Example: "mustache"
strictboolean

When true, Nylas returns an error if the template contains variables that aren't defined in the variables object.

Default: true
Example: true
variables*object

A set of key/value pairs representing variables to substitute for values in the template.

Example: {"user":{"name":"Leyah","surname":"Miller"},"foo":"testing successful"}

Responses

request_id*string

The ID of the request.

Example: "3907012912-13b5a9a4-f136-4761-a31b-68c6a8af825d"
data*object
POSThttps://api.us.nylas.com/v3/grants/nyla%40example.com/templates/render

Find your API key in the Nylas Dashboard under API Keys in your application settings.

grant_idrequiredstring

ID of the grant to access. You can also use the email address associated with the grant, or use /me/ to refer to the grant associated with an access token.

Loading editor...

Autocomplete and validation come from this endpoint's request schema.