Enviar un correo
POST
/v1/mail/send
const url = 'https://api.mailerdash.com/v1/mail/send';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"personalizations":[{"to":[{"email":"recipient@example.com","name":"Recipient Name"}]}],"from":{"email":"no-reply@example-domain.com","name":"Service Name"},"subject":"Email subject","content":[{"type":"text/plain","value":"Hello world"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.mailerdash.com/v1/mail/send \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "personalizations": [ { "to": [ { "email": "recipient@example.com", "name": "Recipient Name" } ] } ], "from": { "email": "no-reply@example-domain.com", "name": "Service Name" }, "subject": "Email subject", "content": [ { "type": "text/plain", "value": "Hello world" } ] }'Envía un correo usando un payload tipo SendGrid. Requiere API key en el header Authorization.
Authorizations
Sección titulada «Authorizations »Request Body required
Sección titulada «Request Body required » Media type application/json
object
personalizations
required
Array<object>
object
to
required
Array<object>
object
email
required
string format: email
Example
recipient@example.com name
string
Example
Recipient Name from
required
object
email
required
string format: email
Example
no-reply@example-domain.com name
string
Example
Service Name subject
required
string
Example
Email subject content
required
Array<object>
object
type
required
string
Example
text/plain value
required
string
Example
Hello worldResponses
Sección titulada « Responses »Accepted – message queued for delivery
Media type application/json
object
message
string
app
string
Example
{ "message": "accepted", "app": "example-app"}Invalid JSON or request body
Media type application/json
object
message
string
Example
{ "message": "Invalid JSON body"}Missing or invalid API key
From domain not authorized
Internal server error