Create Template Render
POST {{baseUrl}}/api/templates/:id/render/
Render a template with the given template ID and context attribute. Returns the HTML and plain text versions of the email template.
Request body parameters (nested under attributes
):
return_fields
: Request specific fields using sparse fieldsets.context
: This is the context your email template will be rendered with. You must pass in acontext
object as a JSON object.
Email templates are rendered with contexts in a similar manner to Django templates. Nested template variables can be referenced via dot notation. Template variables without corresponding context
values are treated as FALSE
and output nothing.
Ex. { "name" : "George Washington", "state" : "VA" }
Rate limits:
Burst: 3/s
Steady: 60/m
Scopes:
Templates Read
Request Body
{"data"=>{"type"=>"template", "id"=>"TEMPLATE_ID", "attributes"=>{"return_fields"=>["Ut qui pariatur officia", "amet dolor deserunt"]}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
revision | string | (Required) API endpoint revision (format: YYYY-MM-DD[.suffix]) | |
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"data":{"type":"template","id":"voluptate minim ex","attributes":{"company_id":"enim fugiat velit labore","name":"irure mollit tempor","editor_type":"id dolore","html":"in molli","text":"ex in labore ut","created":"1984-05-06T13:55:11.862Z","updated":"1974-06-24T06:20:25.722Z"},"links":{"self":"https://GZiHtzoWKLcwUyEZOEiIp.jghepl8x6EqBIUYrIp3EgXuCtWM2AKy+38eHMfnKYxm+mjuezcmi8bz38YINQvDsOnx8pNAI"}}}