Create Template Render

POST {{baseUrl}}/api/template-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 a context 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", "attributes"=>{"id"=>"irure id amet", "context"=>{"first_name"=>"Jane", "last_name"=>"Smith"}, "return_fields"=>["Excepteur laborum Lorem", "dolor est eiusmod"]}}}

HEADERS

KeyDatatypeRequiredDescription
revisionstring(Required) API endpoint revision (format: YYYY-MM-DD[.suffix])
Content-Typestring
Acceptstring

RESPONSES

status: Created

{"data":{"type":"template","id":"ullam","attributes":{"company_id":"COMPANY_ID","name":"qui culpa eu sunt","editor_type":"eu in laboris","html":"laborum eiusmod aliquip","text":"nulla aliquip eiusmod","created":"2022-11-08T00:00:00","updated":"2022-11-08T00:00:00"},"links":{"self":"http://sPUUdEPMFdBqpDfDGxxkhFXDDkPJvsGZ.mtlNeKbUZkf"}}}