Send Transactional Email (Attachments)

Transactional emails can be sent along with an attachment by specifying the following in the attachments field of the request body:

  • File name
  • Data

Endpoint

Method URL
POST https://api.everlytic.net/transactional/email/v1/mail

URL

https://api.everlytic.net/transactional/email/v1/mail

Request Body

{
    "headers": {
        "subject": "Attachment Test",
        "to": [
            {
                "email": “[email protected]",
                "name": "Joe Bloggs”
            },
            {
                "email": “[email protected]",
                "name": “Money Penny”
            },
            {
                "email": "[email protected]",
                "name": "James Bond”
            },
            {
                "email": “[email protected]",
                "name": “Sherlock Holmes”
            }
        ],
        "from": {
            "email": “[email protected]",
            "name": “Bob Smith”
        }
    },
    "options": {
        "group_name": "Testing Attachments",
        "track_links": true,
        "track_opens": false
    },
    "body": {
        "html": "Testing Attachments"
    },
    "attachments": {
        "data": [
            {
                "filename": "info.txt",
                "data": "ZCwyMDE0LTA2LTIwIDA0OjQ3OjA2KzAyMDAsMjAxNC0wNi0yMCAwNDo0NzowNSswMjAwLDM1NzM4M2FkLTJhOTAtNDUxZC04ZjFhLTA4ZjcyZWU2ZDA2MkBuZXV0cm9uLmluY2UtbWFpbC5jb20sZGVvbnBoQGdtYWlsLmNvbSwscmVsYXllZCwyLjAuMCAoc3VjY2Vzcyksc210cDsyNTAgMi4wLjAgT0sgMTQwMzIzMjQyNiB2MTdzaTg3OTIxNDFxZ2UuMjEgLSBnc210cCxnbWFpbC1zbXRwLWluLmwuZ29vZ2xlLmNvbSAoMTczLjE5NC42OC4yNyksLHNtdHAsbG9jYWxob3N0ICgxMC4xMC4yMDQuMTgpLHNtdHAsMTAuMTEuMTk3LjEyMiwxNzMuMTk0LjY4LjI3LCJFTkhBTkNFRFNUQVRVU0NPREVTLFBJUEVMSU5JTkcsQ0hVTktJTkcsOEJJVE1JTUUsU0laRSxTVEFSVFRMUyIsODIwNDcsdi10Ni5tdGEtMi5jb20sLCxnbWFpbC5jb20vdi10Ni5tdGEtMi5jb20scG9vbC10cmFuc2FjdGlvbmFsDQpkLDIwMTQtMDYtMjAgMDQ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BuZXRmbG9yaXN0LmNvLnphPg0KDQoNCg0KDQogY2FzZSBNZXNzYWdlU3RhdHVzLk5PX1FVT1RBOg0KICAgICAgICByZXR1cm4gdGhpcy5nZXRTdGF0cyhzZW5kSXRlbSwgTWVzc2FnZVN0YXR1cy5GQUlMRUQpOw=="
            }
        ]
    }
}

Example Request

curl --location 'https://api.everlytic.net/transactional/email/v1/mail' \
--header 'Content-Type: application/json' \
--data-raw '{
  "body": {
    "html": "

Example Response

{
  "transactions": [
    {
      "id": "e36243a7-e38b-44fb-8deb-c311ef124a64"
    }
  ]
}