Skip to content
Corven Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Mailtrap

Send through Mailtrap Email Sending while preserving all acknowledgment IDs.

Import mailtrapEmailLayer from @corven/email-sdk/mailtrap to provide the common Email service for this account.

Configure the account

import { Layer } from "effect";
import type { Redacted } from "effect";
import { mailtrapEmailLayer } from "@corven/email-sdk/mailtrap";
import { emailHttpLayer } from "./sending.js";

export const configuredMailtrapAccount = (apiKey: Redacted.Redacted) =>
  mailtrapEmailLayer({
    apiKey,
    automaticBcc: "DomainDisabled",
    automaticFooter: "DomainDisabled",
    tracking: "DomainDisabled",
  }).pipe(Layer.provide(emailHttpLayer));

The example reuses the explicit HTTP Layer. Acquire credentials in trusted host code, then provide this account Layer to your sending program.

Message behavior

  • This entrypoint uses Email Sending, not an implicit local inbox or sandbox transport.
  • Attest that automatic BCC, footer insertion and tracking are disabled for the sending domain. The SDK does not inspect those settings.
  • Attachments support both MIME modes and inline placement. Metadata and one category tag are supported; scheduling is not.
  • Keep every ID in AcceptedWithIds. ID order does not map IDs to recipients.

Idempotency

This adapter declares no send key support. Multiple message IDs are correlation evidence, not replay permission.

Read field support before switching accounts, and receipts and retries before adding recovery behavior. Configuration and local validation do not authenticate the account or prove delivery.