MailPace
Send through the MailPace API, a deliberately minimal adapter for address fields and body content.
The MailPace adapter calls the MailPace send API with plain fetch. It has the smallest adapter surface in the SDK: addresses, subject, and body only, with recipient lists serialized as comma-separated strings.
Configure
Create a server token in the MailPace dashboard and verify the sending domain.
import { createEmailClient } from "@opencoredev/email-sdk";
import { mailpace } from "@opencoredev/email-sdk/mailpace";
export const email = createEmailClient({
adapters: [mailpace({ apiKey: process.env.MAILPACE_API_KEY! })],
});
apiKeystring
MailPace server token, sent as the MailPace-Server-Token header.
stringbaseUrl?string
Override the API origin, e.g. for a proxy.
string"https://app.mailpace.com/api/v1"fetch?typeof fetch
Custom fetch implementation for tests or special runtimes.
typeof fetchSend
MailPace maps cc, bcc, and replyTo alongside html/text (sent as htmlbody/textbody). That is the whole surface, which makes it a good fit for sign-in alerts, receipts, and other plain notifications.
const result = await email.send({
from: "Acme <hello@acme.com>",
to: "user@example.com",
replyTo: "support@acme.com",
subject: "New sign-in to your account",
text: "A new sign-in from Berlin, Germany was detected. If this was not you, reset your password.",
});
console.log(result.id); // MailPace message id (`id` or `message_id` in the response)
Verify from the CLI
MAILPACE_API_KEY="..." npx email-sdk doctor --adapter mailpace
MAILPACE_API_KEY="..." npx email-sdk send \
--adapter mailpace \
--from "Acme <hello@acme.com>" \
--to user@example.com \
--subject "MailPace smoke test" \
--text "It works" \
--dry-run
Drop --dry-run for one real send to confirm the token and verified domain work end to end.