Send Email Transactional
Sends an email using the provided JSON body.
This method is suitable for production usage and allows for more complex email configurations.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”The request body for sending an email.
This request body should be a JSON object containing the necessary fields to send an email.
object
object
The name of the sender.
John Doe
The email address of the sender.
john@doe.com
object
The name of the recipient.
Jane Smith
The email address of the recipient.
jane@smith.com
The subject of the email.
Welcome to Our Service
The content of the email.
Hello, this is a test email.
The HTML content of the email.
<p>Hello, this is a test email.</p>
Variables to be used in the email template. Variables avalaible from A to Z. You can define variables like variable_a_var, variable_b_var, etc.
These variables can be used in dynamic content like {{variable_a_var}}.
object
Use on dynamic content like {{variable_a_var}}.
Variable A Value
A list of files to be attached to the email.
Each file can be specified by its name and URL
(Max size allowed 10MB).
object
The name of the file to be attached.
document.pdf
The URL of the file to be attached.
The file will be downloaded and attached to the email.
https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf
A list of files to be attached to the email.
Each file can be specified by its name and base64 encoded content
(Max size allowed 10MB).
object
The name of the file to be attached.
document.pdf
The base64 encoded content of the file to be attached.
This is useful for small files that can be sent directly in the request.
data:(mime type),base64,JVBERi0xLjQKJazc... (base64 content)
Responses
Section titled “ Responses ”Email sent successfully.
object
true
Email sent successfully
A list of sent email identifiers.
Your key auth is not valid
object
true
Your key auth is not valid, please check with your administrator to get the new key
Example
{ "status": false, "error": true, "description": "Your key auth is not valid, please check with your administrator to get the new key"}
Your account dont have credits availables for send
object
true
Your account dont have credits availables for send this, please contact your administrator
Example
{ "status": false, "error": true, "description": "Your account dont have credits availables for send this, please contact your administrator"}
Missing required parameters
object
true
Missing params, please verify or contact to support
Example
{ "status": false, "error": true, "description": "Missing params, please verify or contact to support"}
Examples
Section titled “Examples ”Useful for guiding users to view code examples in different developer languages.
curl -X POST "https://api.example.com/v1/send/email" \ -H "Accept: application/json" \ -H "Connection: keep-alive" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <your-token>" \ -d '{"from":{"name":"John Doe","email":"john@doe.com"},"to":[{"name":"Jane Smith","email":"jane@smith.com"}],"subject":"Welcome to Our Service","text":"Hello, this is a test email.","html":"<p>Hello, this is a test email.</p>","variables":{"variable_a_var":"Variable A Value"},"attachment":[{"name":"document.pdf","url":"https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf"}],"attachment_buffer":[{"name":"document.pdf","content":"data:(mime type),base64,JVBERi0xLjQKJazc... (base64 content)"}]}'
const fetch = require('node-fetch');
fetch("https://api.example.com/v1/send/email", { method: "POST", headers: { "Accept": "application/json", "Connection": "keep-alive", "Content-Type": "application/json", "Authorization": "Bearer <your-token>"}, body: JSON.stringify({ "from": { "name": "John Doe", "email": "john@doe.com" }, "to": [ { "name": "Jane Smith", "email": "jane@smith.com" } ], "subject": "Welcome to Our Service", "text": "Hello, this is a test email.", "html": "<p>Hello, this is a test email.</p>", "variables": { "variable_a_var": "Variable A Value" }, "attachment": [ { "name": "document.pdf", "url": "https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf" } ], "attachment_buffer": [ { "name": "document.pdf", "content": "data:(mime type),base64,JVBERi0xLjQKJazc... (base64 content)" } ]}) }) .then(res => res.json()) .then(console.log) .catch(console.error);
<?php $curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.example.com/v1/send/email", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_HTTPHEADER => [ "Accept: application/json", "Connection: keep-alive", "Content-Type: application/json", "Authorization: Bearer <your-token>" ], CURLOPT_POSTFIELDS => json_encode({ "from": { "name": "John Doe", "email": "john@doe.com" }, "to": [ { "name": "Jane Smith", "email": "jane@smith.com" } ], "subject": "Welcome to Our Service", "text": "Hello, this is a test email.", "html": "<p>Hello, this is a test email.</p>", "variables": { "variable_a_var": "Variable A Value" }, "attachment": [ { "name": "document.pdf", "url": "https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf" } ], "attachment_buffer": [ { "name": "document.pdf", "content": "data:(mime type),base64,JVBERi0xLjQKJazc... (base64 content)" } ]}) ]);
$response = curl_exec($curl); curl_close($curl); echo $response; ?>
using System.Net.Http; using System.Text; using System.Threading.Tasks;
var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.POST, "https://api.example.com/v1/send/email") { Content = new StringContent("{ \"from\": { \"name\": \"John Doe\", \"email\": \"john@doe.com\" }, \"to\": [ { \"name\": \"Jane Smith\", \"email\": \"jane@smith.com\" } ], \"subject\": \"Welcome to Our Service\", \"text\": \"Hello, this is a test email.\", \"html\": \"<p>Hello, this is a test email.</p>\", \"variables\": { \"variable_a_var\": \"Variable A Value\" }, \"attachment\": [ { \"name\": \"document.pdf\", \"url\": \"https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf\" } ], \"attachment_buffer\": [ { \"name\": \"document.pdf\", \"content\": \"data:(mime type),base64,JVBERi0xLjQKJazc... (base64 content)\" } ]}", Encoding.UTF8, "application/json") }; request.Headers.Add("Accept", "application/json");request.Headers.Add("Connection", "keep-alive");request.Headers.Add("Content-Type", "application/json");request.Headers.Add("Authorization", "Bearer <your-token>"); var response = await client.SendAsync(request); var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody);
import requests import json
url = "https://api.example.com/v1/send/email" headers = { "Accept": "application/json", "Connection": "keep-alive", "Content-Type": "application/json", "Authorization": "Bearer <your-token>" } data = { "from": { "name": "John Doe", "email": "john@doe.com" }, "to": [ { "name": "Jane Smith", "email": "jane@smith.com" } ], "subject": "Welcome to Our Service", "text": "Hello, this is a test email.", "html": "<p>Hello, this is a test email.</p>", "variables": { "variable_a_var": "Variable A Value" }, "attachment": [ { "name": "document.pdf", "url": "https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf" } ], "attachment_buffer": [ { "name": "document.pdf", "content": "data:(mime type),base64,JVBERi0xLjQKJazc... (base64 content)" } ]}
response = requests.post(url, headers=headers, json=data) print(response.text)
import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets;
public class ApiExample { public static void main(String[] args) throws Exception { URL url = new URL("https://api.example.com/v1/send/email"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); conn.setRequestProperty("Accept", "application/json"); conn.setRequestProperty("Connection", "keep-alive"); conn.setRequestProperty("Content-Type", "application/json"); conn.setRequestProperty("Authorization", "Bearer <your-token>");
String jsonInputString = "{\"from\":{\"name\":\"John Doe\",\"email\":\"john@doe.com\"},\"to\":[{\"name\":\"Jane Smith\",\"email\":\"jane@smith.com\"}],\"subject\":\"Welcome to Our Service\",\"text\":\"Hello, this is a test email.\",\"html\":\"<p>Hello, this is a test email.</p>\",\"variables\":{\"variable_a_var\":\"Variable A Value\"},\"attachment\":[{\"name\":\"document.pdf\",\"url\":\"https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf\"}],\"attachment_buffer\":[{\"name\":\"document.pdf\",\"content\":\"data:(mime type),base64,JVBERi0xLjQKJazc... (base64 content)\"}]}"; try(OutputStream os = conn.getOutputStream()) { byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); }
int code = conn.getResponseCode(); System.out.println("Response code: " + code); } }