电子邮件

发送电子邮件

排队交易电子邮件以供交付。

POST/emails
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.acme.io>",
6  "to": [
7    "ada@example.com"
8  ],
9  "subject": "Your sign-in code",
10  "html": "<p>482 913</p>",
11  "tags": [
12    {
13      "name": "category",
14      "value": "auth"
15    }
16  ]
17}'
回应
1{
2  "id": "47be30ca-24b7-48fb-b35d-ff287b89e66d"
3}

Accepts the email and returns HTTP 200 with its ID. Delivery happens asynchronously; follow it with Retrieve email. Send an Idempotency-Key header to retry safely.

身體參數

fromstring所需资源

发件人地址。使用Name <address>作为友好的名称。域名必须验证。

tostring | string[]所需资源

收件人地址,或最多 50 个数组。

subjectstring所需资源

电子邮件主题,最多500个字符。

htmlstring

HTML 主体。除非设置了 text,否则是必需的。

textstring

纯文本正文。提供文本、HTML 或已发布的模板。

ccstring | string[]

复制收件人。计算到 50 个收件人限制。

bccstring | string[]

隐藏副本收件人。计算到 50 个收件人限制。

reply_tostring | string[]

回答去哪里。

tagsobject[]

最多可包含名称和值的十个对象。

templateobject

已发布的模板 ID 或别名和可选变量。

标题

Idempotency-Keystring

最多256个字符,请参阅同位键 。