Runs examples for real against your account. Test keys only; kept in this tab, never stored on our side. Get a key
ZapSMTP / Docs / Templates

Render a template

POST/v1/templates/{id}/render

Preview a stored template with given variables (defaults to its sample variables).

Requires a full-access key.

Missing variables do not fail the preview; they are listed in missing_variables.

Path parameters

idstringrequired
Template id or alias

Body parameters

variablesobject
Variables to render with; when omitted the template's stored sample variables are used.

Errors

restricted_api_keyHTTP 403
not_foundHTTP 404
template not found
template_render_errorHTTP 422
POST/v1/templates/{id}/render
curl -X POST 'https://zapsmtp.xyz/v1/templates/welcome/render' \
  -H "Authorization: Bearer $ZAP_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "variables": {
    "first_name": "Ann"
  }
}'
Set ZAP_API_KEY in your environment.
Response 200 OK
{
  "subject": "Your receipt for A-1042",
  "html": "<p>Hi Jane, thanks for order A-1042.</p>",
  "text": "Hi Jane, thanks for order A-1042.",
  "missing_variables": [],
  "variable_names": [
    "order_id",
    "name"
  ],
  "design": null
}