Render Template
curl --request POST \
--url https://senderr.dev/api/v1/templates/{id}/render \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variables": {
"name": "John Doe",
"email": "john@example.com",
"company": "Acme Corp"
},
"format": "html"
}
'import requests
url = "https://senderr.dev/api/v1/templates/{id}/render"
payload = {
"variables": {
"name": "John Doe",
"email": "john@example.com",
"company": "Acme Corp"
},
"format": "html"
}
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({
variables: {name: 'John Doe', email: 'john@example.com', company: 'Acme Corp'},
format: 'html'
})
};
fetch('https://senderr.dev/api/v1/templates/{id}/render', 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://senderr.dev/api/v1/templates/{id}/render",
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([
'variables' => [
'name' => 'John Doe',
'email' => 'john@example.com',
'company' => 'Acme Corp'
],
'format' => 'html'
]),
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://senderr.dev/api/v1/templates/{id}/render"
payload := strings.NewReader("{\n \"variables\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"company\": \"Acme Corp\"\n },\n \"format\": \"html\"\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://senderr.dev/api/v1/templates/{id}/render")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variables\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"company\": \"Acme Corp\"\n },\n \"format\": \"html\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://senderr.dev/api/v1/templates/{id}/render")
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 \"variables\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"company\": \"Acme Corp\"\n },\n \"format\": \"html\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"html": "<!DOCTYPE html><html><body><h1>Hello John Doe</h1></body></html>"
}{
"error": "Invalid request body",
"code": "VALIDATION_ERROR",
"success": false,
"details": [
{
"field": "variables",
"message": "Variables must be an object"
}
]
}{
"error": "Authentication required",
"success": false
}{
"error": "Template access denied",
"code": "ACCESS_DENIED",
"message": "You must purchase this template to render it",
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"price": "<string>"
}
}{
"error": "Template not found",
"success": false
}{
"error": "API usage limit exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"message": "<string>",
"details": {
"limit": 123,
"remaining": 0,
"reset": "2023-11-07T05:31:56Z",
"resetInSeconds": 123
},
"upgrade_url": "<string>",
"documentation": "<string>"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"success": false
}Templates
Render Template
Render an email template with provided variables. Returns HTML or React format based on request.
POST
/
templates
/
{id}
/
render
Render Template
curl --request POST \
--url https://senderr.dev/api/v1/templates/{id}/render \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variables": {
"name": "John Doe",
"email": "john@example.com",
"company": "Acme Corp"
},
"format": "html"
}
'import requests
url = "https://senderr.dev/api/v1/templates/{id}/render"
payload = {
"variables": {
"name": "John Doe",
"email": "john@example.com",
"company": "Acme Corp"
},
"format": "html"
}
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({
variables: {name: 'John Doe', email: 'john@example.com', company: 'Acme Corp'},
format: 'html'
})
};
fetch('https://senderr.dev/api/v1/templates/{id}/render', 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://senderr.dev/api/v1/templates/{id}/render",
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([
'variables' => [
'name' => 'John Doe',
'email' => 'john@example.com',
'company' => 'Acme Corp'
],
'format' => 'html'
]),
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://senderr.dev/api/v1/templates/{id}/render"
payload := strings.NewReader("{\n \"variables\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"company\": \"Acme Corp\"\n },\n \"format\": \"html\"\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://senderr.dev/api/v1/templates/{id}/render")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variables\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"company\": \"Acme Corp\"\n },\n \"format\": \"html\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://senderr.dev/api/v1/templates/{id}/render")
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 \"variables\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"company\": \"Acme Corp\"\n },\n \"format\": \"html\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"html": "<!DOCTYPE html><html><body><h1>Hello John Doe</h1></body></html>"
}{
"error": "Invalid request body",
"code": "VALIDATION_ERROR",
"success": false,
"details": [
{
"field": "variables",
"message": "Variables must be an object"
}
]
}{
"error": "Authentication required",
"success": false
}{
"error": "Template access denied",
"code": "ACCESS_DENIED",
"message": "You must purchase this template to render it",
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"price": "<string>"
}
}{
"error": "Template not found",
"success": false
}{
"error": "API usage limit exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"message": "<string>",
"details": {
"limit": 123,
"remaining": 0,
"reset": "2023-11-07T05:31:56Z",
"resetInSeconds": 123
},
"upgrade_url": "<string>",
"documentation": "<string>"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"success": false
}Authorizations
BearerAuthSessionAuth
Use your API key from the dashboard. Format: Bearer your-api-key-here
Path Parameters
Template ID
Body
application/json
⌘I