Grant-level templates

Render a template

Renders the specified application-level template with the provided variables.

post/v3/grants/{grant_id}/templates/{template_id}/render

Request body

strictboolean

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

variablesobject required

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

Example request

{
  "strict": true,
  "variables": {
    "user": {
      "name": "Leyah",
      "surname": "Miller"
    }
  }
}

Response

Success. Returns rendered template.

request_idstring required

The ID of the request.

Example response

{
  "request_id": "3822450015-47d9207c-4d06-4e15-b3e7-752c5dd5585d",
  "data": {
    "body": "<p>Hello Leyah, your booking has been confirmed.</p>",
    "subject": "Leyah, your booking is confirmed!"
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.