Learn

Sending emails

Everything a send request can carry, and what happens after.

Every email starts as one POST /emails request. Sendtern validates it, returns 200 OK with its ID, and delivers in the background.

Anatomy of a request

1curl -X POST 'https://sendtern.com/emails' \
2  -H 'Authorization: Bearer st_your_api_key' \
3  -H 'Content-Type: application/json' \
4  -d '{
5  "from": "Acme <hello@mail.example.com>",
6  "to": [
7    "ada@example.com"
8  ],
9  "reply_to": "support@example.com",
10  "subject": "Your sign-in code",
11  "html": "<p>Your code is <strong>482 913</strong></p>",
12  "text": "Your code is 482 913",
13  "tags": [
14    {
15      "name": "category",
16      "value": "auth"
17    }
18  ]
19}'

Sender

from accepts a bare address or Name <address>. Verify the exact sender domain before sending.

Recipients

  • to takes a string or an array, up to 50 addresses per email.
  • cc and bcc work the same way and count toward the 50.
  • reply_to sets where replies go, for example your support inbox.

Content

Send html, text, or both. HTML can have up to 200,000 characters and plain text up to 100,000 characters.

Tags

Send up to 10 tags. Each tag has a name and a value, each up to 128 letters, digits, hyphens or underscores.

After the request

The email starts as queued and moves through the statuses as the recipient's server responds. Use the returned id to retrieve it at any time.