Send email
Sends an email. It is queued immediately and delivered within seconds, or at scheduled_at.
Headers
Idempotency-KeystringOptional. Repeating a request with the same key within 24 hours returns the original email instead of sending again.
Body parameters
fromstringrequiredSender, e.g.
"Acme <[email protected]>". The domain must be verified (or use the sandbox sender). Optional whentemplatehas a default sender.tostring | string[]requiredRecipient addresses. Up to 50 recipients across
to,ccandbcc.subjectstringrequiredSubject line. Optional when
templateprovides one.htmlstringHTML body. Either
html,textortemplateis required.textstringPlain-text body. Generated from
htmlwhen omitted.ccstring | string[]Carbon-copy recipients.
bccstring | string[]Blind carbon-copy recipients.
reply_tostring | string[]Reply-To address(es). Defaults to the template’s, if it has one.
headersobjectCustom MIME headers as name → value pairs, e.g.
{ "X-Entity-Ref-ID": "123" }.attachmentsobject[]Files to attach. Up to 40 MB per email in total, attachments included.
ShowHide 3 item fields
attachments[].filenamestringrequiredFile name shown to the recipient, e.g.
invoice.pdf.attachments[].contentstringrequiredThe file, base64-encoded.
attachments[].content_typestringMIME type, e.g.
application/pdf. Guessed from the file name when omitted.
tagsobject[]Labels echoed in webhooks so you can match events to your own records.
ShowHide 2 item fields
tags[].namestringrequiredTag name, e.g.
category.tags[].valuestringrequiredTag value, e.g.
welcome.
scheduled_atstringISO 8601 timestamp up to 30 days ahead. The email is created with status
scheduled.templateobjectSend a stored template. Its subject, HTML, text, sender and Reply-To are used for any of those you leave out.
ShowHide 2 fields
template.idstringrequiredThe template’s ID or alias, e.g.
"welcome-email".template.variablesobjectValues for the template’s variables, e.g.
{ "name": "Ada" }fills{{name}}. Missing values use the fallback in{{name|fallback}}, or become empty.
To send a stored template, pass its ID or alias with the variables to fill in: { "from": "Acme <[email protected]>", "to": "[email protected]", "template": { "id": "welcome-email", "variables": { "name": "Ada" } } }. Anything you also pass (such as subject) overrides the template’s.
Request
curl -X POST 'https://api.mailvina.com/emails' \
-H 'Authorization: Bearer mv_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"from": "Acme <[email protected]>",
"to": [
"[email protected]"
],
"subject": "Welcome to Acme",
"html": "<p>Hi Ada!</p>",
"tags": [
{
"name": "category",
"value": "welcome"
}
]
}'Response
{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}