メール
メールを送信
トランザクションメールを配信のためにキューに入れます。
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文字まで
htmlstringHTML ボディ。text が設定されていない場合は必要です。
textstring単純テキストのボディ。テキスト、HTML、または公開されたテンプレートを指定します。
ccstring | string[]複写受信者受信者数を 50 にするまで数えてください。
bccstring | string[]BCC 受信者受信者数を 50 にするまで数えてください。
reply_tostring | string[]答えがどこに行くか
templateobjectテンプレートIDまたはエイリアスとオプション変数。
ヘッダ
Idempotency-Keystring最大256文字まで。 同一性キー を参照。