Skip to main content

Send Test Email Template

POST 

/api/store-email-templates/:id/test-send

Sends the (possibly unsaved) template to up to 3 addresses through the store's real sender identity, with the subject prefixed "[Test] " and no CC or BCC.

Required scope: settings:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token and the email_templates.update permission. Limited to 10 per user per hour (429).

Body fields:

  • to (array of emails, max 3) — defaults to your own email
  • sample_record_id (int|null) — record to fill the email from; null uses sample data
  • store_id (int|null) — sender store; defaults to the template's store
  • subject, preheader, html_body — unsaved content; the saved values are used when omitted. An explicit "preheader": null (a cleared field) sends no preheader instead of the saved one
  • include_attachments (bool) — attach the template's documents generated for the sample record

Returns 422 store_sender_missing when the store has no sender email address.

Scopes: API tokens need settings:write; when sample_record_id is set, also the read scope of the template context's records (sales_order / bulk_sales_order / sales_credit → orders:read; purchase_order → purchase-orders:read; vendor_credit → accounting:read; bulk_purchase_order → suppliers:read; warehouse_transfer → warehouses:read), else 403 insufficient_scope.

Request​

Responses​

OK

Response Headers
    Content-Type