Overview

By default, transactions are grouped by month. This grouping can be customised by setting the group name in the options field of the request body. All transactional emails that are sent will be aggregated by this group name.

Endpoint

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

Request Body

{
  "body": {
    "html": "<h1>Raw HTML Template</h1>"
  },
  "options": {
    "group_name": "Rest API Using Raw HTML Template"
  },
  "headers": {
    "subject": "Raw HTML Template",
    "from": {
      "email": "[email protected]",
      "name": "Joe Bloggs”
    },
    "to": [
      {
        "email": "[email protected]",
        "name": "John Doe”
      }
    ]
  }
}

Example Request

curl --location 'https://api.everlytic.net/transactional/email/v1/mail' \
--header 'Content-Type: application/json' \
--data-raw '{
  "body": {
    "html": "<h1>Raw HTML Template</h1>"
  },
  "options": {
    "group_name": "Rest API Using Raw HTML Template"
  },
  "headers": {
    "subject": "Raw HTML Template",
    "from": {
      "email": "[email protected]",
      "name": "Joe Bloggs"
    },
    "to": [
      {
        "email": "[email protected]",
        "name": "John Doe”
      }
    ]
  }
}'

Example Response

Email was sent successfully [200 OK]

{
  "transactions": [
    {
      "id": “214d88g4-cbe1-4ff9-88fa-e2947e0f2be7"
    }
  ]
}