comecerodocs

Render a template

POST
/templates/{template_id}/build

Fills the template (and its wrapper and embedded templates) with the JSON object you send and returns the result. Use it to preview an email. Nothing is saved or sent. Your account's details are added as account unless the body has its own. The body must be a JSON object. Secret and trusted tokens may call it; a limited token may not (403).

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

template_id*string

The template id.

Request Body

application/json
  1. body

The values the template reads.

[key: string]?any

Response Body

The rendered template.

application/json
  1. response

A template filled with your data.

data?string

The rendered output, usually HTML, with CSS inlined.

Example Request
curl -X POST 'https://api.comecero.com/api/v1/templates/string/build' \  -H 'Content-Type: application/json' \  -d '{  "customer": {    "first_name": "John"  },  "download_url": "https://example.com/downloads/abc123"}'
Example Response
{  "data": "<p>Hi John, your download is ready: https://example.com/downloads/abc123</p>"}