Getting started
Send your first email
Publish a template, create an API key, and send your first email.
1. Prepare your project
By default, your plan starts in Sandbox mode, where you can test without sending any live emails. For live delivery, complete Sending setup in your dashboard and enable live sending.
2. Publish a template
Choose a template in your project and publish it. Copy its key and variable names from the editor.
3. Create an API key
Create an API key in your project’s API keys page. Save it as SENDERY_API_KEY in your server environment. Keep the key out of browser code and source control.
export SENDERY_API_KEY="your_project_api_key"4. Send an email
Use cURL or your language’s SDK. Replace your-template with your template’s key, data with its variables, and the recipient with your email address.
curl https://sendery.co/api/v1/emails \
-H "Authorization: Bearer $SENDERY_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"to": "[email protected]",
"template": "your-template",
"data": {"name": "Alex", "action_url": "https://example.com/start"}
}'require 'vendor/autoload.php';
use Sendery\Client;
$sendery = new Client(getenv('SENDERY_API_KEY'));
$receipt = $sendery->send(
to: '[email protected]',
template: 'your-template',
data: ['name' => 'Alex', 'action_url' => 'https://example.com/start'],
);
echo $receipt['id'];import { Sendery } from '@sendery/sdk';
const apiKey = process.env.SENDERY_API_KEY;
if (!apiKey) throw new Error('Set SENDERY_API_KEY on your server.');
const sendery = new Sendery(apiKey);
const receipt = await sendery.send({
to: '[email protected]',
template: 'your-template',
data: { name: 'Alex', action_url: 'https://example.com/start' },
});
console.log(receipt.id);package main
import (
"context"
"fmt"
"log"
"os"
"github.com/sendery-co/sendery-go"
)
func main() {
client, err := sendery.NewClient(os.Getenv("SENDERY_API_KEY"))
if err != nil {
log.Fatal(err)
}
receipt, err := client.Send(context.Background(), sendery.SendEmailInput{
To: "[email protected]",
Template: "your-template",
Data: map[string]any{
"name": "Alex",
"action_url": "https://example.com/start",
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(receipt.ID)
}import os
from sendery import Sendery
sendery = Sendery(os.environ["SENDERY_API_KEY"])
receipt = sendery.send(
to="[email protected]",
template="your-template",
data={"name": "Alex", "action_url": "https://example.com/start"},
)
print(receipt["id"])import co.sendery.Sendery;
import java.util.Map;
public class SendEmail {
public static void main(String[] args) {
var sendery = new Sendery(System.getenv("SENDERY_API_KEY"));
var receipt = sendery.send("[email protected]", "your-template", Map.of(
"name", "Alex",
"action_url", "https://example.com/start"
));
System.out.println(receipt.id());
}
}import co.sendery.Sendery
fun main() {
val sendery = Sendery(System.getenv("SENDERY_API_KEY"))
val receipt = sendery.send("[email protected]", "your-template", mapOf(
"name" to "Alex",
"action_url" to "https://example.com/start"
))
println(receipt.id())
}5. Check the result
A 202 response confirms acceptance. Save the returned id to check delivery status. Sandbox responses also include sandbox_url. Open it while signed in to view the email; sandbox content is retained for 1 day.
{
"id": "35a6b227-1748-412e-8651-430492201670",
"status": "queued",
"sandbox_url": "https://sendery.co/en/app/projects/5656/activity/35a6b227-1748-412e-8651-430492201670"
}6. Retrieve the email
Replace the example ID below with the ID returned by your send request.
curl https://sendery.co/api/v1/emails/35a6b227-1748-412e-8651-430492201670 \
-H "Authorization: Bearer $SENDERY_API_KEY" \
-H 'Accept: application/json'