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
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://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_idis 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:
| Field | Type | Required | Description |
|---|---|---|---|
company_id | integer | Yes | Must be an existing account inside your own account tree. |
type | string | Yes | Valid EmailTemplateType value. |
header | string | No | nullable, base64 HTML, max:80000, token-validated. Falls back to saved/resolved if omitted. |
body | string | No | nullable, base64 HTML, max:80000, token-validated. |
footer | string | No | nullable, base64 HTML, max:80000, token-validated. |
signature | string | No | nullable, base64 HTML, max:80000, token-validated. |
subject_override | string | No | nullable, max:255, token-validated. Plain text. |
template_mode | string | No | nullable, regions or html. Defaults to saved value. |
custom_html | string | No | nullable, base64 HTML, max:400000. Used in html mode. |
show_logo | boolean | No | Not 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
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
422{
"message": "The selected type is invalid.",
"errors": {
"type": [
"The selected type is invalid."
]
}
}Errors
| Status | Meaning |
|---|---|
401 | The bearer token is missing, expired or invalid |
403 | The template type is platform-managed, or the email-template section is disabled for your account |
422 | Validation Error |
500 | Unexpected 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}'Updated 10 days ago
Did this page help you?
