How to send emails via Transactional API?
To send emails you need to have an Access Key and a Delivery Route configured.
How to get an Access Key for Transactional API?
- Click on the account name displayed at the top right side, and click on Account > API Keys.
- Click on Create API Key.
- Enter a value of your choice for label. Label is for your identification.
- Choose the Role as Relay Email and click on Create API Key.
- Copy the API Key that we have just created.
API end point to send Transactional Email
The API are REST based.
URL: https://relayapi.elasticsendy.com/api/rest/relay/email/v1
Accesskey: <copied from prev step>
To authorize the request has to be POST and the request header has to contain the following request headers
Key: Authorization
Value: Bearer access_key
and
Key: Content-Type
Value: application/json
The format of the body content should be in the following JSON format.
{
"recipients": {
"to": [
{
"name": "Recipient Name",
"email": "[email protected]"
}
]
},
"from": {
"name": "Sender name",
"email": "[email protected]"
},
"subject": "This is test subject",
"content": [
{
"type": "text/html",
"value": "<div>This is a sample content</div>"
}
]
}