unemail
Version:
A modern TypeScript email library with zero dependencies, supporting multiple providers including AWS SES, Resend, MailCrab, and HTTP APIs
44 lines (40 loc) • 1.48 kB
text/typescript
import { EmailOptions, SmtpConfig } from 'unemail/types';
import { ProviderFactory } from './base.mjs';
/**
* SMTP-specific email options
*/
interface SmtpEmailOptions extends EmailOptions {
dsn?: {
/** Request successful delivery notification */
success?: boolean;
/** Request notification on failure */
failure?: boolean;
/** Request notification on delay */
delay?: boolean;
};
/** Message priority: 'high', 'normal', or 'low' */
priority?: 'high' | 'normal' | 'low';
/** Reference to a previous message ID (for threading) */
inReplyTo?: string;
/** References to related message IDs */
references?: string | string[];
/** List-Unsubscribe header for easy unsubscribe functionality */
listUnsubscribe?: string | string[];
/** Special Google Mail headers */
googleMailHeaders?: {
/** Mark as promotional content */
promotionalContent?: boolean;
/** Feedback ID for engagement tracking */
feedbackId?: string;
/** Category for email organization */
category?: 'primary' | 'social' | 'promotions' | 'updates' | 'forums';
};
/** Whether to sign the email with DKIM */
useDkim?: boolean;
}
/**
* SMTP provider for sending emails via SMTP protocol
*/
declare const smtpProvider: ProviderFactory<SmtpConfig, any, SmtpEmailOptions>;
export { smtpProvider as default, smtpProvider };
export type { SmtpEmailOptions };