TypeScript SDK
Thesimpleemailapi package provides a fully typed, backend-first SDK for Node.js workflows.
Installation
Usage
Initialize the client with your API key and use theclient.send method.
The
from address must belong to a domain you have verified.Client Configuration
ThecreateClient function accepts the following options:
Your API Key, starting with
sea_live_.API endpoint URL. Defaults to
https://api.simpleemailapi.dev.arguments
Theclient.send method accepts an object with the following properties:
Sender email address. Must be from a verified domain.
List of primary recipient email addresses.
Email subject line.
Plain text content of the email.
HTML content of the email.
List of CC recipient email addresses.
List of BCC recipient email addresses.
List of files to attach.
Email address to use for the Reply-To header. // Actually proto has inReplyTo for threading, but standard email APIs usually have replyTo. Proto has
inReplyTo. Let’s stick to exact types from SendEmailRequest.Message-ID of the email being replied to (for threading).
List of message IDs for threading context.
Custom headers. // Proto has
metadata, effectively custom headers/metadata.Custom key-value metadata.
Schedule the email for future delivery.
If true, queue for async processing (we handle retries). If false, send synchronously. Emails with attachments are always async.