Email

This API allows you to send email messages to your audience. using automatic route switcher for fast message delivery. API accepts and returns JSON-encoded requests and responses.

post
Send Email

https://api.tagget.io/engage/send_email
API endpoint to send an email message through your Tagget account from a third-party app.
Request
Response
Request
Body Parameters
id
required
string
Your Tagget account id.
reply_to
required
string
Email address to be replied to.
subject
required
string
Subject of the mail you are sending out.
body
required
string
The actual content of your email body.
sender
required
string
Preferred alphanumeric sender name i.e Tagget
token
required
string
Your Tagget account secret token
Response
200: OK
SMS has been sent successfully.
{
"status": 200,
"message": "Email has been sent to recipient successfully.",
"data": {
"id": "YOUR_ID",
"token": "YOUR_TOKEN",
"sender": "Tagget",
"body": "Hello world",
"to": "email@gmail.com",
"subject": "Email message subject";
"reply_to": "reply@gmail.com"
}
}
400: Bad Request
Your SMS request wasn't successful.
{
"status": 400,
"message": "Error sending SMS message to recipient.",
"data": null
}
JavaScript
Python
JavaScript
var data = JSON.stringify({
"id": "YOUR_ID",
"token": "YOUR_TOKEN",
"sender": "Tagget",
"body": "Hello world",
"to": "example@gmail.com",
"subject": "Email message subject";
"reply_to": "reply@gmail.com"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.tagget.io/engage/send_email");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.send(data);
Python
import requests
url = "https://api.tagget.io/engage/send_email"
payload = "{\n\t\"id\":\"YOUR_ID\",\n\t\"token\":\"YOUR_TOKEN\",\n\t\"sender\":\"Tagget\",\n\t\"body\": \"Hello world\",\n\t\"to\": \"example@gmail.com\"\n}"
headers = {
'content-type': "application/json",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)