Invia email
Metti in coda un'email transazionale per la consegna.
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.
Parametri del corpo
fromstringrichiestoIndirizzo del mittente. Utilizza Name <address> per un nome amichevole. Il dominio deve essere verificato.
tostring | string[]richiestoIndirizzo del destinatario o un array fino a 50.
subjectstringrichiestoOggetto dell'email, fino a 500 caratteri.
htmlstringCorpo HTML. Obbligatorio a meno che text non sia impostato.
textstringFornire testo, HTML o un modello pubblicato.
ccstring | string[]Destinatari Cc. Contare fino al limite di 50 destinatari.
bccstring | string[]Destinatari Ccn. Contare fino al limite di 50 destinatari.
reply_tostring | string[]Dove vanno le risposte.
templateobjectUn ID o alias del modello pubblicato e variabili facoltative.
Intestazioni
Idempotency-KeystringFino a 256 caratteri. Vedere Tasti di identicità.