> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/test-emails/send-a-test-email.md). Agents can also search and read this documentation through its [MCP server](https://apidocs.akinon.com/~gitbook/mcp).

# Send a test email

Sends a single email with the given HTML body and subject to one or more recipients. The body is delivered as-is with an `html` content type — no stored template is applied.

Intended for internal QA of the email-editor feature. Requires a staff (admin) token; the sender is the platform's configured no-reply address.

The `to` field accepts either a JSON array of addresses or a single comma-separated string (for example `"a@example.com, b@example.com"`); both forms are normalised to a list, and every address must be a valid email. The email is sent synchronously, so a `202` response means the message was handed to the mail backend for delivery.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Test Emails","description":"A single administrative endpoint for sending a **test email** with an arbitrary HTML body, subject and recipient list. It exists to support QA of the email-editor feature: paste the HTML a template produces, choose who receives it, and trigger a real send so the rendered result can be checked in an actual inbox.\n\nThis endpoint does **not** use any of the platform's stored email templates. The HTML you send is delivered as-is (with an `html` content type), so it is only a delivery mechanism for content you have already composed elsewhere.\n\n> **Internal use only.** The endpoint requires a staff (admin) token and is intended for internal team/QA use. It is not a general-purpose mail-sending API and must not be exposed to storefront users, since an unrestricted sender would be an open mail-relay / spam vector.\n\nThe sender address is the platform's configured no-reply address; only the recipients, subject and body are supplied by the caller."}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/v1/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"schemas":{"SendTestEmailRequest":{"type":"object","description":"The recipients, subject and HTML body of a test email.","required":["to","subject","html"],"properties":{"to":{"description":"The recipients. Either a JSON array of email addresses, or a single\ncomma-separated string of addresses. At least one address is required\nand each must be a valid email.","oneOf":[{"type":"array","items":{"type":"string","format":"email"},"minItems":1},{"type":"string"}]},"subject":{"type":"string","description":"The email subject line."},"html":{"type":"string","description":"The raw HTML body, delivered as-is with an `html` content type."}}},"ValidationError":{"type":"object","description":"Returned when the request contains invalid or missing data. Errors are grouped by the field they apply to: each key is the name of a field from the request and its value is a list of one or more messages describing what is wrong with that field. Messages that do not belong to any single field are grouped under `non_field_errors`.","properties":{"non_field_errors":{"type":"array","description":"Error messages that apply to the request as a whole rather than to a specific field.","items":{"type":"string"}}},"additionalProperties":{"type":"array","description":"The list of error messages for the field named by the key.","items":{"type":"string"}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"ValidationError":{"description":"The request contains invalid or missing data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/send-test-email/":{"post":{"tags":["Test Emails"],"operationId":"sendTestEmail","summary":"Send a test email","description":"Sends a single email with the given HTML body and subject to one or more\nrecipients. The body is delivered as-is with an `html` content type — no\nstored template is applied.\n\nIntended for internal QA of the email-editor feature. Requires a staff\n(admin) token; the sender is the platform's configured no-reply address.\n\nThe `to` field accepts either a JSON array of addresses or a single\ncomma-separated string (for example `\"a@example.com, b@example.com\"`);\nboth forms are normalised to a list, and every address must be a valid\nemail. The email is sent synchronously, so a `202` response means the\nmessage was handed to the mail backend for delivery.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTestEmailRequest"}}}},"responses":{"202":{"description":"The email was accepted and handed to the mail backend for delivery."},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/test-emails/send-a-test-email.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
