PHP
<?php
$client = new isend('YOUR_API_KEY');
$client->emails->send([
'from' => 'your@email.com',
'to' => 'delivered@isend.dev',
'template' => 'welcome_emailer',
'data_mapping' => [
'name' => 'John Doe',
'email' => 'john@example.com'
]
]);import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"from": "your@email.com",
"to": "delivered@isend.dev",
"template": "welcome_emailer",
"data_mapping": {
"name": "John Doe",
"email": "john@example.com"
}
}
response = requests.post("https://api.example.com/api/send-email", json=data, headers=headers)
print(response.json())const axios = require('axios');
const response = await axios.post('https://api.example.com/api/send-email', {
from: 'your@email.com',
to: 'delivered@isend.dev',
template: 'welcome_emailer',
data_mapping: {
name: 'John Doe',
email: 'john@example.com'
}
}, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
console.log(response.data);OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"from\":\"your@email.com\",\"to\":\"delivered@isend.dev\",\"template\":\"welcome_emailer\",\"data_mapping\":{\"name\":\"John Doe\",\"email\":\"john@example.com\"}}");
Request request = new Request.Builder()
.url("https://api.example.com/api/send-email")
.post(body)
.addHeader("Authorization", "Bearer YOUR_API_KEY")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://api.example.com/api/send-email")
header = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
body = {
from: 'your@email.com',
to: 'delivered@isend.dev',
template: 'welcome_emailer',
data_mapping: {
name: 'John Doe',
email: 'john@example.com'
}
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = body.to_json
response = http.request(request)
puts response.bodycurl -X POST https://api.example.com/api/send-email \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "your@email.com",
"to": "delivered@isend.dev",
"template": "welcome_emailer",
"data_mapping": {
"name": "John Doe",
"email": "john@example.com"
}
}'const options = {method: 'POST'};
fetch('https://api.example.com/api/send-email', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/send-email"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Email
Send Email
Sends a templated email to a recipient using dynamic data.
POST
/
api
/
send-email
PHP
<?php
$client = new isend('YOUR_API_KEY');
$client->emails->send([
'from' => 'your@email.com',
'to' => 'delivered@isend.dev',
'template' => 'welcome_emailer',
'data_mapping' => [
'name' => 'John Doe',
'email' => 'john@example.com'
]
]);import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"from": "your@email.com",
"to": "delivered@isend.dev",
"template": "welcome_emailer",
"data_mapping": {
"name": "John Doe",
"email": "john@example.com"
}
}
response = requests.post("https://api.example.com/api/send-email", json=data, headers=headers)
print(response.json())const axios = require('axios');
const response = await axios.post('https://api.example.com/api/send-email', {
from: 'your@email.com',
to: 'delivered@isend.dev',
template: 'welcome_emailer',
data_mapping: {
name: 'John Doe',
email: 'john@example.com'
}
}, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});
console.log(response.data);OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"from\":\"your@email.com\",\"to\":\"delivered@isend.dev\",\"template\":\"welcome_emailer\",\"data_mapping\":{\"name\":\"John Doe\",\"email\":\"john@example.com\"}}");
Request request = new Request.Builder()
.url("https://api.example.com/api/send-email")
.post(body)
.addHeader("Authorization", "Bearer YOUR_API_KEY")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://api.example.com/api/send-email")
header = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
body = {
from: 'your@email.com',
to: 'delivered@isend.dev',
template: 'welcome_emailer',
data_mapping: {
name: 'John Doe',
email: 'john@example.com'
}
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = body.to_json
response = http.request(request)
puts response.bodycurl -X POST https://api.example.com/api/send-email \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "your@email.com",
"to": "delivered@isend.dev",
"template": "welcome_emailer",
"data_mapping": {
"name": "John Doe",
"email": "john@example.com"
}
}'const options = {method: 'POST'};
fetch('https://api.example.com/api/send-email', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/send-email"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Send Email
Send templated emails through the iSend API using dynamic placeholders with a single API call.
Endpoint
POST https://api.isend.ai/emails/send
Headers
- Authorization (string, required): Bearer token using your API key.
Example:Authorization: Bearer is_xxxxxxx - Content-Type:
application/json
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
from | string | ✅ | Sender’s email. Use name <email@domain.com> format if needed. |
to | string or array | ✅ | Email or array of emails for recipients. |
template | string | ✅ | Identifier or name of the template to send. |
data_mapping | object | ✅ | Dynamic placeholder values to inject into the template. |
Sample Request
{
"from": "your@email.com",
"to": "delivered@isend.dev",
"template": "welcome_emailer",
"data_mapping": {
"name": "John Doe",
"email": "john@example.com"
}
}
Sample Response
{
"id": "abc1234-def5-6789-xyz-00000000",
"status": "success"
}
PHP SDK Example
<?php
$client = new isend('YOUR_API_KEY');
$client->emails->send([
'from' => 'your@email.com',
'to' => 'delivered@isend.dev',
'template' => 'welcome_emailer',
'data_mapping' => [
'name' => 'John Doe',
'email' => 'john@example.com'
]
]);
Notes
- Ensure the
templateexists and is active on your account. data_mappingmust match the placeholders used in your template.- You may use an array for
toif you want to send to multiple recipients.
Response
200
Successful response
⌘I
