SDK method
emails.send
POST /emailssend a single transactional message.
Signature
ts
send(input: SendEmailRequest): Promise<SendEmailResponse>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
from | string | Address | yes | Sender — `"Name <addr>"`, a bare address, or an `Address`. The domain owns the Message-ID. |
to | Recipients | yes | — |
cc | Recipients | no | — |
bcc | Recipients | no | — |
subject | string | yes | — |
html | string | no | — |
text | string | no | — |
template | string | no | Render a stored template by id or name, substituting `data` merge tags (`*|FNAME|*`, conditionals, …) server-side — the "ad-hoc mailer with dynamic templates" path. Mutually exclusive with `html` (a template renders the html for you). A server that doesn't have the named template REJECTS the send with a clear error (never a silent empty send). |
data | Record<string, unknown> | no | Merge-tag values for `template` (keyed by tag, e.g. `{ FNAME: "Ada" }`). |
reply_to | string | Address | no | Reply-To header, wire format. |
replyTo | string | Address | no | JS-friendly alias for `reply_to`. |
headers | Record<string, string> | no | Extra headers — `X-*` only (others are rejected 422). |
in_reply_to | string | no | Message-ID this send replies to (TBX-29). Threads the send onto that existing conversation instead of starting a new one — both on the wire (real In-Reply-To/References headers) and in the Sent folder. |
inReplyTo | string | no | JS-friendly alias for `in_reply_to`. |
references | string[] | no | Full ancestry chain, oldest first. Usually the parent's `references` + its Message-ID. |
attachments | Attachment[] | no | — |
idempotency_key | string | no | Idempotency key. The HTTP API also accepts an `Idempotency-Key` header. |
idempotencyKey | string | no | JS-friendly alias for `idempotency_key`. |
onReply | DirectiveAction | no | Attach reply logic to this thread (GTM-thread-directives): when a reply lands on the thread this send starts, the platform's inbound pipeline honors this directive — draft/send/ask/notify. One call, one thread, zero new client concepts. A server that predates directives REJECTS this field with a clear error (never silently drops it). Snake `on_reply` is also accepted. |
on_reply | DirectiveAction | no | — |
drip | DripStep[] | no | A timed follow-up sequence on this thread — each step fires after its `after` delay (only if no reply arrived, unless `ifNoReply:false`). "send + onReply + drip in one call." Snake `drip` is the same field (no alias needed). |
Returns
Promise<SendEmailResponse>
Example
ts
const tinbox = new Tinbox({ apiKey: "tbx_…", host: "https://acme.com" });
await tinbox.emails.send({
from: "Ada <ada@acme.dev>",
to: "user@example.com",
subject: "Welcome",
html: "<p>Hello!</p>",
});