SDKs
Official SDKs
Mailtactic provides first-party SDKs for the most popular server-side languages. All SDKs are generated from the same OpenAPI spec — they’re always in sync with the API.
Node.js / TypeScript
Installation
npm install @mailtactic/node
# or
pnpm add @mailtactic/node
Usage
import { Mailtactic } from '@mailtactic/node';
const client = new Mailtactic({
apiKey: process.env.MAILTACTIC_API_KEY,
});
// Send a message
const result = await client.messages.send({
to: 'user@example.com',
from: 'noreply@yourdomain.com',
subject: 'Welcome to our app',
html: '<h1>Welcome!</h1>',
text: 'Welcome!',
});
console.log(result.id); // message event ID
// Send with a template
await client.messages.send({
to: 'user@example.com',
from: 'noreply@yourdomain.com',
templateId: 'welcome-email',
variables: { firstName: 'Alice' },
});
Python
Installation
pip install mailtactic
Usage
from mailtactic import Mailtactic
client = Mailtactic(api_key=os.environ["MAILTACTIC_API_KEY"])
result = client.messages.send(
to="user@example.com",
from_address="noreply@yourdomain.com",
subject="Welcome!",
html="<h1>Welcome!</h1>",
)
print(result.id)
Other languages
Don’t see your language? The REST API works from any HTTP client. All request and response schemas are published in our OpenAPI spec.
Community SDKs:
- Ruby —
gem install mailtactic - PHP —
composer require mailtactic/mailtactic-php - Go —
go get github.com/mailtactic/mailtactic-go
SDK versioning
SDKs follow semantic versioning. Breaking changes are never introduced in minor or patch releases. Subscribe to our changelog to be notified of new releases.
What’s next
- REST API — send without an SDK
- API Reference — full endpoint documentation
- Getting started — your first email in 5 minutes