Send Email

Send Email

POST https://api.saino.io/api/apis/email/send

This endpoint allows you to send an email.

Headers

Name
Type
Description

Authorization

string

It is a bearer authentication token to validate request coming from a valid user or not. You can get this token from Saino first account from API keys section. if you passing programmtically then follow below approach: Authorization: "Bearer " + API_KEY

Request Body

Name
Type
Description

to

array

This is to contain email ids where you need to send emails. you can add multiple email ids where you need to send emails

subject

string

This contains email subject

from

string

This is a from email id. you can assigned only verified email id. you can verify from email id from sainofirst dashboard by below-specified section. dashboard -> bulk email -> settings-> domain

fromName

string

Display name for from email address

bodyHtml

string

This field used to send html content in email either bodyHtml or bodyText is required

bodyText

string

This field used to send normal text content in email either bodyHtml or bodyText is required

trackClicks

boolean

Should the click be tracked? If no value has been provided, Account's default setting will be used.

trackOpens

boolean

Should the opens be tracked? If no value has been provided, Account's default setting will be used

replyToEmail

string

Email address to reply to

replyToName

string

Name to replay to name

attachments

array

An array of ID's of attachments. Note: you can get attachment id from uploading attachment by upload attachment API

callbackUrl

string

Call back where you received notifications related to email.

{ 
    status: true, 
    message: "Success",
    campaignId:"8asd6sx-as6tasvdt-asdg532v"
}

Callback Url response

below is the notification response received in provided callback url related to each email id.

{
    emailId: "test@test.com",  //provided to email id
    status: "sent/opened/clicked/bounce/complaint/unsubscribed", //this is email status
    campaignId: "8asd6sx-as6tasvdt-asdg532v"  //campaign id to identify
}

Examples

var axios = require('axios');
var data = JSON.stringify(
  {
    "to":["test@gmail.com"],
    "subject":"API test 1",
    "from":"test@domain.com",
    "fromName":"sahil",
    "bodyHtml":"<h1>Test 1</h1>",
    "trackClicks":true,
    "trackOpens":true,
    "replyToEmail":"test2@domain2.com",
    "attachments":[],
    "replyToName":"sam",
    "bodyText":"Just Text Email",
    "callbackUrl":"https://domain.com/webhook"
  }
);

var config = {
  method: 'post',
  url: 'https://api.saino.io/api/apis/email/send',
  headers: { 
    'Authorization': 'Bearer 808ciij4p18351yml==/pitzkg67bizz0qce1599144457846', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config).then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Last updated