Sendr Docs

Quickstart

Send your first email with Sendr in under 5 minutes.

1. Get an API key

Sign in to the Sendr dashboard, go to API Keys, and create a new key. Copy the key — it starts with sndr_live_ for live mode or sndr_test_ for test mode.

Store it as an environment variable:

export SENDR_API_KEY="sndr_live_your_api_key_here"

2. Verify a sending domain

Before sending, you need at least one verified domain. Go to Domains in the dashboard, add your domain, and follow the DNS setup guide. DNS propagation usually takes a few minutes.

For testing, use test-mode API keys — they bypass domain verification and capture emails to the Test Inbox instead of delivering them.

3. Send your first email

npm install sendr
# or: bun add sendr
import { Sendr } from "sendr";

const sendr = new Sendr(process.env.SENDR_API_KEY!);

const email = await sendr.emails.send({
  from: "you@yourdomain.com",
  to: "user@example.com",
  subject: "Hello from Sendr!",
  html: "<h1>Welcome!</h1><p>Your first email just worked.</p>",
});

console.log(email.id); // em_abc123
console.log(email.status); // "queued"
pip install sendr
import os
import sendr

client = sendr.Client(api_key=os.environ["SENDR_API_KEY"])

email = client.emails.send(
    from_="you@yourdomain.com",
    to="user@example.com",
    subject="Hello from Sendr!",
    html="<h1>Welcome!</h1><p>Your first email just worked.</p>",
)

print(email.id)     # em_abc123
print(email.status) # queued
go get github.com/sendr/sendr-go
package main

import (
    "fmt"
    "os"
    "github.com/sendr/sendr-go"
)

func main() {
    client := sendr.New(os.Getenv("SENDR_API_KEY"))

    email, err := client.Emails.Send(sendr.SendEmailRequest{
        From:    "you@yourdomain.com",
        To:      "user@example.com",
        Subject: "Hello from Sendr!",
        HTML:    "<h1>Welcome!</h1><p>Your first email just worked.</p>",
    })
    if err != nil {
        panic(err)
    }

    fmt.Println(email.ID)     // em_abc123
    fmt.Println(email.Status) // queued
}
curl -X POST https://api.sendr.dev/v1/emails \
  -H "Authorization: Bearer $SENDR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "you@yourdomain.com",
    "to": "user@example.com",
    "subject": "Hello from Sendr!",
    "html": "<h1>Welcome!</h1><p>Your first email just worked.</p>"
  }'

Response:

{
  "id": "em_abc123",
  "from": "you@yourdomain.com",
  "to": ["user@example.com"],
  "subject": "Hello from Sendr!",
  "status": "queued",
  "created_at": "2025-03-12T09:00:00Z"
}

4. Check delivery status

const email = await sendr.emails.get("em_abc123");
console.log(email.status); // "delivered"

Status values: queuedsentdelivered (or bounced / complained).

5. Set up a webhook (optional)

Get notified when delivery events happen:

await sendr.webhooks.create({
  url: "https://yourapp.com/webhooks/sendr",
  events: ["email.delivered", "email.bounced", "email.opened", "email.clicked"],
});

See the Webhook Verification guide for payload signing and HMAC verification.

Next steps

On this page