Self-hosted HTTP API zum Versand transaktionaler E-Mails via SMTP.
Jeder Request benötigt einen Authorization-Header mit Bearer Token.
# Header
Authorization: Bearer YOUR_API_KEY
curl -X POST https://dispatch.knerpi.de/emails \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "noreply@dispatch.knerpi.de",
"to": ["empfaenger@example.com"],
"subject": "Hallo Welt",
"html": "<p>Das ist meine erste Mail.</p>",
"text": "Das ist meine erste Mail."
}'
// Antwort (200 OK)
{
"id": "3c4a1b2e-...@dispatch.knerpi.de"
}
| Feld | Typ | Pflicht | Beschreibung |
|---|---|---|---|
from |
string | ja | Absender-Adresse |
to |
string[] | ja | Empfänger (ein oder mehrere) |
subject |
string | ja | Betreff |
html |
string | ja* | HTML-Body (*oder react_template) |
text |
string | nein | Plaintext-Fallback |
react_template |
string | nein | Name eines Server-Templates (statt html) |
react_props |
object | nein | Props für das Template |
reply_to |
string | nein | Reply-To Adresse |
cc |
string[] | nein | CC-Empfänger |
bcc |
string[] | nein | BCC-Empfänger |
headers |
object | nein | Zusätzliche Mail-Header |
curl -X POST https://dispatch.knerpi.de/emails \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "noreply@dispatch.knerpi.de",
"to": ["empfaenger@example.com"],
"subject": "Willkommen",
"react_template": "welcome",
"react_props": { "name": "Arne" }
}'
/opt/dispatch-api/src/templates/ als JSX-Dateien.
Verfügbare Templates: GET /templates