Email Templates
Browse the email templates available for newsletters. Newsletter html_content is rendered into the template's {{ content }} slot when an email_template_id is provided.
/api/v1/email-templatesList email templates for the authenticated client. Returns active templates by default; pass ?archived=true for archived templates.
Response Fields
idintegerThe template ID.
namestringThe template display name.
html_contentstringThe HTML wrapper. Newsletter html_content is rendered into the {{ content }} slot.
is_defaultbooleanTrue when this template is the account default.
is_systembooleanTrue when this is a system-provided template (no client_id).
archived_atstring|nullISO 8601 timestamp when archived, or null.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.
Request
curl -X GET \
"https://byomailer.com/api/v1/email-templates" \
-H "Authorization: Bearer {your-api-token}" \
-H "Accept: application/json"Response
{
"data": [
{
"id": 1,
"name": "Default wrapper",
"html_content": "<table>...{{ content }}...</table>",
"is_default": true,
"is_system": false,
"archived_at": null,
"created_at": "2024-02-01T08:00:00.000000Z",
"updated_at": "2024-02-01T08:00:00.000000Z"
}
],
"meta": {
"path": "https://byomailer.com/api/v1/email-templates",
"per_page": 25,
"next_cursor": null,
"prev_cursor": null
}
}/api/v1/email-templates/defaultGet the active default email template for the authenticated client. Returns {"data": null} when no default is set.
Response Fields
idintegerThe template ID.
namestringThe template display name.
html_contentstringThe HTML wrapper. Newsletter html_content is rendered into the {{ content }} slot.
is_defaultbooleanTrue when this template is the account default.
is_systembooleanTrue when this is a system-provided template (no client_id).
archived_atstring|nullISO 8601 timestamp when archived, or null.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.
Request
curl -X GET \
"https://byomailer.com/api/v1/email-templates/default" \
-H "Authorization: Bearer {your-api-token}" \
-H "Accept: application/json"Response
{
"data": {
"id": 1,
"name": "Default wrapper",
"html_content": "<table>...{{ content }}...</table>",
"is_default": true,
"is_system": false,
"archived_at": null,
"created_at": "2024-02-01T08:00:00.000000Z",
"updated_at": "2024-02-01T08:00:00.000000Z"
}
}/api/v1/email-templates/{emailTemplateId}Get a single email template by ID.
Path Parameters
emailTemplateIdintegerThe template ID.
Response Fields
idintegerThe template ID.
namestringThe template display name.
html_contentstringThe HTML wrapper. Newsletter html_content is rendered into the {{ content }} slot.
is_defaultbooleanTrue when this template is the account default.
is_systembooleanTrue when this is a system-provided template (no client_id).
archived_atstring|nullISO 8601 timestamp when archived, or null.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.
Request
curl -X GET \
"https://byomailer.com/api/v1/email-templates/{emailTemplateId}" \
-H "Authorization: Bearer {your-api-token}" \
-H "Accept: application/json"Response
{
"data": {
"id": 1,
"name": "Default wrapper",
"html_content": "<table>...{{ content }}...</table>",
"is_default": true,
"is_system": false,
"archived_at": null,
"created_at": "2024-02-01T08:00:00.000000Z",
"updated_at": "2024-02-01T08:00:00.000000Z"
}
}