Skip to main content
POST
/
email
/
templates
/
{templateId}
/
preview
Preview template
curl --request POST \
  --url https://www.dench.com/api/v1/email/templates/{templateId}/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "data": {
    "firstName": "Ada",
    "company": "Lovelace Labs"
  }
}
'
{
  "subject": "Hi Ada",
  "htmlBody": "<p>Hi Ada, saw your work at Lovelace Labs.</p>",
  "variableNames": [
    "company",
    "firstName"
  ]
}

Authorizations

Authorization
string
header
required

Workspace-scoped Dench API key from workspace settings. This is the same key used by DENCH_API_KEY in sandboxes.

Path Parameters

templateId
string
required

Body

application/json
data
object

Personalization data for {{variable}} placeholders.

Response

Successful response

subject
string
required
htmlBody
string
required
variableNames
string[]
required
textBody
string