Send a transactional email
Sends one email from a marketing template to a single recipient, personalised with dataVariables. Intended for functional messages (password resets, receipts, confirmations): no unsubscribe link, no open or click tracking, and delivery does not depend on the recipient’s subscription status.
curl --request POST \
--url https://api.jetemail.com/marketing/transactional \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactionalId": "<string>",
"email": "jane@example.com",
"dataVariables": {
"firstName": "Jane",
"resetUrl": "https://app.example.com/reset/abc"
},
"subject": "<string>",
"fromName": "<string>",
"fromEmail": "<string>",
"replyTo": "<string>",
"addToAudience": true,
"audienceIds": [
"<string>"
],
"attachments": [
{
"filename": "<string>",
"data": "<string>"
}
]
}
'import requests
url = "https://api.jetemail.com/marketing/transactional"
payload = {
"transactionalId": "<string>",
"email": "jane@example.com",
"dataVariables": {
"firstName": "Jane",
"resetUrl": "https://app.example.com/reset/abc"
},
"subject": "<string>",
"fromName": "<string>",
"fromEmail": "<string>",
"replyTo": "<string>",
"addToAudience": True,
"audienceIds": ["<string>"],
"attachments": [
{
"filename": "<string>",
"data": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transactionalId: '<string>',
email: 'jane@example.com',
dataVariables: {firstName: 'Jane', resetUrl: 'https://app.example.com/reset/abc'},
subject: '<string>',
fromName: '<string>',
fromEmail: '<string>',
replyTo: '<string>',
addToAudience: true,
audienceIds: ['<string>'],
attachments: [{filename: '<string>', data: '<string>'}]
})
};
fetch('https://api.jetemail.com/marketing/transactional', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jetemail.com/marketing/transactional",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'transactionalId' => '<string>',
'email' => 'jane@example.com',
'dataVariables' => [
'firstName' => 'Jane',
'resetUrl' => 'https://app.example.com/reset/abc'
],
'subject' => '<string>',
'fromName' => '<string>',
'fromEmail' => '<string>',
'replyTo' => '<string>',
'addToAudience' => true,
'audienceIds' => [
'<string>'
],
'attachments' => [
[
'filename' => '<string>',
'data' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.jetemail.com/marketing/transactional"
payload := strings.NewReader("{\n \"transactionalId\": \"<string>\",\n \"email\": \"jane@example.com\",\n \"dataVariables\": {\n \"firstName\": \"Jane\",\n \"resetUrl\": \"https://app.example.com/reset/abc\"\n },\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"addToAudience\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"data\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jetemail.com/marketing/transactional")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactionalId\": \"<string>\",\n \"email\": \"jane@example.com\",\n \"dataVariables\": {\n \"firstName\": \"Jane\",\n \"resetUrl\": \"https://app.example.com/reset/abc\"\n },\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"addToAudience\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"data\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jetemail.com/marketing/transactional")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionalId\": \"<string>\",\n \"email\": \"jane@example.com\",\n \"dataVariables\": {\n \"firstName\": \"Jane\",\n \"resetUrl\": \"https://app.example.com/reset/abc\"\n },\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"addToAudience\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"data\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "<string>",
"messageId": "<string>"
}Authorizations
API key for account management endpoints. Use your api_ prefixed token.
Body
Template id to send
Recipient
"jane@example.com"
Merge values for {{firstName}}, {{resetUrl}}, custom fields, …
{
"firstName": "Jane",
"resetUrl": "https://app.example.com/reset/abc"
}
Overrides the template subject
Overrides the template sender name
Overrides the template from address. Defaults to the template sender if omitted. Must be on a verified sending domain.
Overrides the template reply-to
Upsert the recipient as a contact
Audiences to add the contact to (with addToAudience)
Optional file attachments, 25 MB total. Same shape as /email: filename plus base64-encoded data.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.jetemail.com/marketing/transactional \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transactionalId": "<string>",
"email": "jane@example.com",
"dataVariables": {
"firstName": "Jane",
"resetUrl": "https://app.example.com/reset/abc"
},
"subject": "<string>",
"fromName": "<string>",
"fromEmail": "<string>",
"replyTo": "<string>",
"addToAudience": true,
"audienceIds": [
"<string>"
],
"attachments": [
{
"filename": "<string>",
"data": "<string>"
}
]
}
'import requests
url = "https://api.jetemail.com/marketing/transactional"
payload = {
"transactionalId": "<string>",
"email": "jane@example.com",
"dataVariables": {
"firstName": "Jane",
"resetUrl": "https://app.example.com/reset/abc"
},
"subject": "<string>",
"fromName": "<string>",
"fromEmail": "<string>",
"replyTo": "<string>",
"addToAudience": True,
"audienceIds": ["<string>"],
"attachments": [
{
"filename": "<string>",
"data": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transactionalId: '<string>',
email: 'jane@example.com',
dataVariables: {firstName: 'Jane', resetUrl: 'https://app.example.com/reset/abc'},
subject: '<string>',
fromName: '<string>',
fromEmail: '<string>',
replyTo: '<string>',
addToAudience: true,
audienceIds: ['<string>'],
attachments: [{filename: '<string>', data: '<string>'}]
})
};
fetch('https://api.jetemail.com/marketing/transactional', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jetemail.com/marketing/transactional",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'transactionalId' => '<string>',
'email' => 'jane@example.com',
'dataVariables' => [
'firstName' => 'Jane',
'resetUrl' => 'https://app.example.com/reset/abc'
],
'subject' => '<string>',
'fromName' => '<string>',
'fromEmail' => '<string>',
'replyTo' => '<string>',
'addToAudience' => true,
'audienceIds' => [
'<string>'
],
'attachments' => [
[
'filename' => '<string>',
'data' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.jetemail.com/marketing/transactional"
payload := strings.NewReader("{\n \"transactionalId\": \"<string>\",\n \"email\": \"jane@example.com\",\n \"dataVariables\": {\n \"firstName\": \"Jane\",\n \"resetUrl\": \"https://app.example.com/reset/abc\"\n },\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"addToAudience\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"data\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jetemail.com/marketing/transactional")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transactionalId\": \"<string>\",\n \"email\": \"jane@example.com\",\n \"dataVariables\": {\n \"firstName\": \"Jane\",\n \"resetUrl\": \"https://app.example.com/reset/abc\"\n },\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"addToAudience\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"data\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jetemail.com/marketing/transactional")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionalId\": \"<string>\",\n \"email\": \"jane@example.com\",\n \"dataVariables\": {\n \"firstName\": \"Jane\",\n \"resetUrl\": \"https://app.example.com/reset/abc\"\n },\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"addToAudience\": true,\n \"audienceIds\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"data\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "<string>",
"messageId": "<string>"
}