Email API for developers
An email API that is quick to integrate and easy to test.
Tratto is an email API for developers: one REST API for transactional email, campaigns and automation flows, with SDKs for Node.js, Python and PHP. Test keys run the whole pipeline without delivering anything, sends are idempotent, and webhooks are signed. It is hosted in the EU, with 3,000 emails free a month.
Join the betaSend an email
import { Tratto } from '@tratto/email';
const tratto = new Tratto(process.env.TRATTO_API_KEY!);
const { id } = await tratto.emails.send({
from: 'Acme <[email protected]>',
to: '[email protected]',
subject: 'Welcome!',
markdown: '# Welcome\n\nGlad to have you on board.',
});Markdown is rendered server-side into responsive HTML with a plain-text part. html and templateId work too.
What you get
SDKs for Node.js, Python and PHP
@tratto/email ships TypeScript types; tratto-email has no external dependencies and runs on Python 3.10+; tratto/email runs on PHP 8.1+ with the curl extension and nothing else. Any other language talks to the REST API over plain HTTP.
Test keys and a simulator
A tratto_test_ key runs the same pipeline (statuses, timeline, webhooks) but delivers nothing and needs no verified domain. Simulator addresses produce a delivery, a hard or soft bounce, or a complaint on demand.
Idempotent sends
Send an Idempotency-Key header and a retry within 24 hours returns the original response instead of a second email. A different payload with the same key is refused.
Signed webhooks
Every webhook delivery is signed with HMAC-SHA256 over a timestamp and the payload, in the X-Tratto-Signature header, so you can reject anything that did not come from Tratto.
Markdown emails
Write the email in emailmd Markdown and the API renders it into responsive, email-safe HTML plus a text part. Templates accept Markdown too.
Scheduling
Pass scheduledAt to send an email or a campaign later; a scheduled email can be cancelled or moved before it goes out.
Questions
- Which languages are supported?
- There are official SDKs for Node.js (@tratto/email), Python (tratto-email) and PHP (tratto/email). Every other language uses the REST API directly; the documentation has plain HTTP examples.
- Can I try it without verifying a domain?
- Yes, with a test key (tratto_test_). Test sends go through the whole pipeline, statuses and webhooks included, without being delivered and without a verified domain. They do not consume the monthly quota and are capped at 100 emails a day.
- Does Tratto support SMTP?
- Not yet: an SMTP relay is on the roadmap. Today Tratto is a REST API with SDKs for Node.js, Python and PHP.
- Can I use React Email?
- There is no React Email integration. You can render your components to HTML yourself and send the result in the html field, or write the email in Markdown and let the API render it.
- Where is the data stored?
- In EU regions: Firestore eur3 for the database, BigQuery europe-west1 for email events, AWS SES eu-west-1 for delivery. Every provider is listed on the sub-processors page.