Get an email template
Overview
Get an email type's current template for editing.
Use this to load it into your editor.
You'll need the company_id and the template type.
Returns the template content and settings: your saved version (override), what is actually sent (resolved) and the defaults (defaults). HTML regions are base64-encoded; subjects are plain text.
Prerequisites
- A bearer token. See Authentication.
- The account's id (
company_id), with the email templates section turned on. - The email
type, from List email types.
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/get
Authentication
Partner or Account token
company_idmust be inside your own account tree. A Partner token can use any account under the partner; an Account token only its own account.- An account outside your tree, or one that doesn't exist, is rejected with
422. - The email templates section must be turned on for the account's partner (
email_templates_enabledin Get branding). When it's off, every email template call for that account returns403withThe email template section is disabled for this account. - Types managed centrally by the platform return
403(This template is managed centrally and cannot be edited here.).
Rate limit
This endpoint has no rate limit.
Request parameters
None.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
company_id | integer | Yes | The account. Must exist and be inside your account tree. |
type | string | Yes | The email type, from List email types. |
Request payload
{
"company_id": 5994,
"type": "user_welcome"
}Response body
The payload is inside data. HTML regions are base64-encoded.
| Field | Type | Description |
|---|---|---|
status | string | success. |
data | object | The template. |
data.type | string | The email type. |
data.override | object | Your saved content. Each field is null when you haven't saved it. |
data.override.header | string or null | Saved header (base64 HTML). |
data.override.body | string or null | Saved body (base64 HTML). |
data.override.footer | string or null | Saved footer (base64 HTML). |
data.override.signature | string or null | Saved signature (base64 HTML). |
data.override.subject_override | string or null | Saved subject (plain text). |
data.override.custom_html | string or null | Saved full-HTML body (base64). |
data.template_mode | string | regions or html. |
data.resolved | object | What is sent: your content where saved, else the default. |
data.resolved.header | string | Header (base64 HTML; empty when there is none). |
data.resolved.body | string | Body (base64 HTML). |
data.resolved.footer | string | Footer (base64 HTML; empty when there is none). |
data.resolved.signature | string | Signature (base64 HTML). |
data.resolved.subject | string | Subject (plain text, with merge fields). |
data.is_enabled | boolean | Whether it's sent. |
data.show_logo | boolean | Whether the logo is shown. |
data.delivery_method | string | direct or webhook. |
data.customized | boolean | Whether you have saved your own content or subject. |
data.theme | object | Theme values used in the email. |
data.theme.primary_color | string | The partner's brand colour. |
defaults | object | The default template. |
defaults.header | string | Default header (base64 HTML). |
defaults.body | string | Default body (base64 HTML). |
defaults.footer | string | Default footer (base64 HTML). |
defaults.signature | string | Default signature (base64 HTML). |
defaults.subject | string | Default subject (plain text). |
defaults.custom_html | string | Starting point for html mode: the default header, body and signature together (base64 HTML). |
Response payload
{
"data": {
"status": "success",
"data": {
"type": "user_welcome",
"override": {
"header": null,
"body": "PHA+SGkgdGhlcmUsPC9wPg==",
"footer": null,
"signature": null,
"subject_override": "Welcome aboard, [customerName]!",
"custom_html": null
},
"template_mode": "regions",
"resolved": {
"header": "",
"body": "PHA+SGkgdGhlcmUsPC9wPg==",
"footer": "",
"signature": "PHA+VGhhbmsgeW91LDxicj48c3Ryb25nPltwYXJ0bmVyVGl0bGVdPC9zdHJvbmc+PC9wPg==",
"subject": "Welcome aboard, [customerName]!"
},
"is_enabled": true,
"show_logo": true,
"delivery_method": "direct",
"customized": true,
"theme": {
"primary_color": "#1459c4"
}
},
"defaults": {
"header": "",
"body": "PHA+SGkgdGhlcmUsPC9wPg==",
"footer": "",
"signature": "PHA+VGhhbmsgeW91LDxicj48c3Ryb25nPltwYXJ0bmVyVGl0bGVdPC9zdHJvbmc+PC9wPg==",
"subject": "Welcome to [partnerTitle]",
"custom_html": "PHA+SGkgdGhlcmUsPC9wPg=="
}
}
}Examples
Success payload
See Response payload.
Error payload
403 Email templates section is off
{
"message": "The email template section is disabled for this account.",
"status": "error",
"errors": []
}403 Type managed centrally
{
"message": "This template is managed centrally and cannot be edited here.",
"status": "error",
"errors": []
}422 type is missing
{
"message": "The type field is required.",
"errors": {
"type": [
"The type field is required."
]
}
}422 type isn't a known email type
{
"message": "The selected type is invalid.",
"errors": {
"type": [
"The selected type is invalid."
]
}
}422 Account outside your tree
{
"message": "The selected company id does not belong to your company hierarchy.",
"errors": {
"company_id": [
"The selected company id does not belong to your company hierarchy."
]
}
}| Status | Meaning |
|---|---|
200 | The template. |
401 | The token is missing, expired or invalid. |
403 | The email templates section is off for this account, or the type is managed centrally. |
422 | company_id or type is missing or invalid, or the account is outside your tree. |
500 | Unexpected server error. |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/account/white-label/email-templates/get" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"company_id": 5994, "type": "user_welcome"}'Updated 17 days ago
Did this page help you?
