Mailtrap
Configure the Mailtrap Email Sending API adapter.
import { createEmailClient } from "@opencoredev/email-sdk";
import { mailtrap } from "@opencoredev/email-sdk/mailtrap";
const email = createEmailClient({
adapters: [mailtrap({ apiKey: process.env.MAILTRAP_API_KEY! })],
});
Options
| Option | Type | Required | Notes |
|---|---|---|---|
apiKey |
string |
Yes | Mailtrap API token. |
baseUrl |
string |
No | Defaults to https://send.api.mailtrap.io. |
fetch |
typeof fetch |
No | Useful for tests or custom runtimes. |
See field support for supported message fields.
Mailtrap maps replyTo to reply_to, metadata to custom_variables, and the first returned message_ids value to the SDK response ID.