Email
Sends an email or a bunch of emails
While sending you can provide substitutions (merge tags), use a template, turn on read or click tracking, etc.
Restrictions:
- maximum request size is 10 MB
- maximum number of recipients is 500
- The symbol '/' is not allowed in attachment names
If the list of recipients contains invalid, non-existent, duplicate, or unsubscribed emails, those emails will be returned in the output parameter failed_emails, and the email will be sent to all other valid emails addresses. If all the emails addresses fall into failed_emails, sending will not be carried out and API error 204 will be returned.
post/email/send.json
Request
- Base URL: https://api.unione.io/en/transactional/api/v1
- URL: https://api.unione.io/en/transactional/api/v1/email/send.json
- Auth: API key in header X-API-KEY
Request body
Example request
{
"message": {
"recipients": [
{
"email": "email@example.com",
"substitutions": {
"tag": "value"
},
"metadata": {
"key": "value"
}
}
],
"template_id": "00000000-0000-0000-0000-000000000000",
"tags": [],
"global_language": "en",
"template_engine": "velocity",
"body": {
"html": "<b>Hello, b;b;to_namec;c;</b>",
"plaintext": "Hello, b;b;to_namec;c;",
"amp": "<!doctype html><html amp4email><head> <meta charset=\"utf-8\"><script async src=\"https://cdn.ampproject.org/v0.js\"></script> <style amp4email-boilerplate>body{visibility:hidden}</style></head><body> Hello, AMP4EMAIL world.</body></html>"
},
"subject": "UniOne test email ",
"from_email": "email@example.com",
"from_name": "John Smith",
"reply_to": "email@example.com",
"reply_to_name": "John Smith",
"idempotence_key": "SG1VsbG68sIH2dvc5mx890kIQ",
"headers": {
"X-MyHeader": "some data",
"Test-List-Unsubscribe": "<mailto: unsubscribe@example.com?subject=unsubscribe>, <http://www.example.com/unsubscribe/b;b;CustomerIdc;c;>"
},
"attachments": [
{
"type": "text/plain",
"name": "readme.txt",
"content": "SGVsbG8sIHdvcmxkIQ=="
}
],
"inline_attachments": [
{
"type": "image/gif",
"name": "IMAGECID1",
"content": "R0lGODdhAwADAIABAP+rAP///ywAAAAAAwADAAACBIQRBwUAOw=="
}
],
"options": {}
}
}Response
Email successfully accepted for sending.
Example response
{
"job_id": "1ZymBc-00041N-9X",
"failed_emails": {
"email1@gmail.com": "temporary_unavailable",
"bad@address": "invalid",
"email@example.com": "duplicate",
"root@example.org": "permanent_unavailable",
"olduser@example.net": "unsubscribed"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.