Preview a template (render-only)

Overview

Renders the template with sample variable values and returns the resulting HTML + resolved subject. Draft region fields (base64) can be posted to preview unsaved edits. Deterministic tokens (partner title, theme colours) resolve from live white-label data; recipient/review/location tokens use sample placeholders. Never sends an email.

Prerequisites

  • A bearer token. Callable with Partner and Account tokens.

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

POST /api/v1/account/white-label/email-templates/preview

Authentication

  • Requires a bearer token in the Authorization: Bearer <bearer-token> header.

  • Who can call it: Partner and Account tokens.

  • Authentication plus an email-template feature check.

  • company_id is scoped by an ownership check.

  • Platform-owned types are forbidden (403) for non-platform companies.

  • Only the reachable companies differ per role.

Rate limit

  • No rate limit.

Request body

  • Body:
FieldTypeRequiredDescription
company_idintegerYesMust be an existing account inside your own account tree.
typestringYesValid EmailTemplateType value.
headerstringNonullable, base64 HTML, max:80000, token-validated. Falls back to saved/resolved if omitted.
bodystringNonullable, base64 HTML, max:80000, token-validated.
footerstringNonullable, base64 HTML, max:80000, token-validated.
signaturestringNonullable, base64 HTML, max:80000, token-validated.
subject_overridestringNonullable, max:255, token-validated. Plain text.
template_modestringNonullable, regions or html. Defaults to saved value.
custom_htmlstringNonullable, base64 HTML, max:400000. Used in html mode.
show_logobooleanNoNot in rules; read by the controller to override logo visibility for this preview only.
{
  "company_id": 1,
  "type": "user_welcome",
  "body": "PHA+SGVsbG8gW3JlY2lwaWVudE5hbWVdPC9wPg==",
  "show_logo": true
}

Response

  • data.status (string) — success.
  • data.data.html (string) — fully rendered email HTML document.
  • data.data.subject (string) — resolved, variable-applied, tag-stripped subject.

200 OK · 200

{
  "data": {
    "status": "success",
    "data": {
      "html": "<!DOCTYPE html>\n<html><head><title>Review Management</title></head><body><table class=\"wrapper\"><tr><td class=\"header\"><img src=\"https://cdn.example.com/logo.png\" alt=\"Acme\"></td></tr><tr><td class=\"content-cell\"><p>Thank you for signing up, Jane.</p><p>Thank you,<br><strong>Acme Reviews</strong></p></td></tr></table></body></html>",
      "subject": "Welcome aboard, Jane!"
    }
  }
}

422 Validation Error · 422

{
  "message": "The selected type is invalid.",
  "errors": {
    "type": [
      "The selected type is invalid."
    ]
  }
}

Errors

StatusMeaning
401The bearer token is missing, expired or invalid
403The template type is platform-managed, or the email-template section is disabled for your account
422Validation Error
500Unexpected server error

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/account/white-label/email-templates/preview" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"company_id": 1, "type": "user_welcome", "body": "PHA+SGVsbG8gW3JlY2lwaWVudE5hbWVdPC9wPg==", "show_logo": true}'

Did this page help you?