Email Contents

Preview Email Content

Preview email content with test variables.

Required Scopes: email:read

Use Case:

  • Test how email will look with specific contact/company data
  • Preview personalization before launching campaigns
  • Debug variable replacement issues

Example Request:

{
  "variables": {
    "contact.name": "Jane Smith",
    "contact.email": "jane@example.com",
    "company.name": "Tech Solutions Inc",
    "hero_title": "Exclusive Offer for You",
    "cta_url": "https://example.com/special-offer"
  }
}

Features:

  • Compiles content with provided variable values
  • Returns rendered HTML and subject line
  • Returns list of variables used in content
  • Useful for testing personalization before sending campaign

Resolution rules: company.* and system.* always come from your real workspace data and agent.* from the requesting user (never example values). contact.* / contact.custom.* come from variables.contact; a contact field that is not supplied renders as an empty string. To personalise for a real contact, use POST /email-contents/{id}/render.

post/api/v1/email-contents/{content_id}/preview

Request

  • Base URL: https://api.sendseven.com
  • URL: https://api.sendseven.com/api/v1/email-contents/{content_id}/preview
  • Auth: HTTP bearer

Path parameters

content_idstring required

Request body

variablesobject

Test variables to render (e.g., {'contact': {'name': 'John'}})

Example request

{
  "variables": {
    "company": {
      "name": "Acme Corp"
    },
    "contact": {
      "email": "john@example.com",
      "name": "John Doe"
    },
    "cta_url": "https://example.com/get-started"
  }
}

Response

Successful Response

html_contentstring nullable

Compiled and rendered HTML (html type)

text_contentstring nullable

Rendered plain text (plain_text type)

subject_linestring required

Rendered subject line

variables_usedstring[] required

Variables found in content

content_typestring

Content type of the previewed content

Example response

{
  "content_type": "html",
  "html_content": "<html><body><h1>Welcome John Doe!</h1></body></html>",
  "subject_line": "Welcome to Acme Corp, John Doe!",
  "variables_used": [
    "contact.name",
    "company.name",
    "cta_url"
  ]
}

Changes

No recorded changes to this operation across all 3 revisions of this API.