Exports
The package has one root entry and a subpath per transport and decorator, each with its own hand-written types. Every name is exported by name, so require() and ESM import give the same values:
js
const { createMessage } = require('@alexify/mailer');
const { SmtpTransport } = require('@alexify/mailer/smtp');js
import { createMessage } from '@alexify/mailer';
import { SmtpTransport } from '@alexify/mailer/smtp';@alexify/mailer
The message model and the transport contract, ported from @upyo/core, and the model of delivery events.
- Messages:
createMessage, and theMessage,MessageConstructor,MessageContent,Address,AttachmentandPrioritytypes, with theListFields,ListUrlandMessageTrackingof thelistandtrackingfields;parseAddress,formatAddress,isEmailAddress,isAttachment,comparePriority. See composing messages. - Attachments:
readAttachmentContent,iterateAttachmentContent. See attachments. - Calendar:
createCalendarAttachment,resolveCalendarContent,parseCalendarMethod. See calendar invitations. - Message-ID and threading:
generateMessageId,parseMessageId,formatMessageId,resolveThreadingHeaders. - Transports: the
Transport,RawTransport,VerifiableTransportandTransportOptionstypes;isRawTransport,isVerifiableTransport,combineSignals. See custom transports. - Receipts: the
ReceiptandReceiptErrortypes;createFailedReceipt,createReceiptError,classifyHttpStatus,classifyReceiptError,parseRetryAfter. - Raw messages: the
RawMessagetype;createRawMessagePlan,iterateRawMessage,analyzeRawMessage,RawMessageValidationError. - Delivery events: the
DeliveryEvent,DeliveryEventTypeandDeliveryBouncetypes, which./webhooksgives. See webhooks and events. - The reliability layer: the
QueueDriver,QueueSource,QueueJob,QueueJobRequest,QueueOutcomeandQueueHandlertypes every driver shares, andMessageState,AuditEventandAuditSink, as types only. See the queue and the audit.
Subpaths
| Subpath | Exports | Page |
|---|---|---|
@alexify/mailer/mime | composeMessage, MimeAttachmentReplayError | MIME |
@alexify/mailer/attachments | fromPath, fromUrl, fromDataUri, fromStream, inlineDataUrls, isPublicUrl | Attachments |
@alexify/mailer/render | renderContent, renderFields, createReactEmailRenderer, htmlToText | Rendering templates |
@alexify/mailer/templates | createTemplateRenderer, createFileLoader, createMemoryLoader, createCssInliner, createEjsEngine, createHandlebarsEngine, createPugEngine, createMjmlEngine, createLiquidEngine, createNunjucksEngine, createEtaEngine, createMustacheEngine, createReactEmailEngine, TemplateNotFoundError, TemplateRenderError, TemplateLoadError | Templates by name |
@alexify/mailer/queue | createMailQueue, createMailJobHandler, createMemoryQueue, createPollingDriver, prepareMailJob, parseMailJob, MailQueueError, QueueLeaseLostError, MAIL_JOB_NAME, MAIL_JOB_VERSION | The queue |
@alexify/mailer/bullmq | createBullMQDriver, createBullMQProcessor, createBullMQBackoffStrategy, MAILER_BACKOFF_TYPE | BullMQ |
@alexify/mailer/mongodb | createMongoOutbox, createMongoAuditSink, createMongoIdempotencyStore | MongoDB outbox |
@alexify/mailer/audit | createMemoryAuditSink, createLoggerAuditSink, combineAuditSinks, stateOf, stateOfDeliveryEvent, auditEventOfDeliveryEvent, isFinalState | The audit |
@alexify/mailer/webhooks | createSesWebhookVerifier, createResendWebhookVerifier, createSendGridWebhookVerifier, createMailgunWebhookVerifier, createPostmarkWebhookVerifier, createMailerSendWebhookVerifier, createMailtrapWebhookVerifier, createBrevoWebhookVerifier, createMailjetWebhookVerifier, createSparkPostWebhookVerifier, createLettermintWebhookVerifier, createMailerooWebhookVerifier, createSmtp2goWebhookVerifier, createAzureWebhookVerifier, createScalewayWebhookVerifier, createMemoryReplayStore, WebhookVerificationError | Webhooks |
@alexify/mailer/smtp | SmtpTransport and its error classes (SmtpResponseError, SmtpAuthError, …), isSmtpResponseProviderDetails, createHttpProxyConnector | SMTP |
@alexify/mailer/sendmail | SendmailTransport | Sendmail |
@alexify/mailer/ses | SesTransport | Amazon SES |
@alexify/mailer/resend | ResendTransport | Resend |
@alexify/mailer/sendgrid | SendGridTransport, SendGridApiError | SendGrid |
@alexify/mailer/mailgun | MailgunTransport, MailgunApiError | Mailgun |
@alexify/mailer/mailtrap | MailtrapTransport, createMailtrapConfig and its error classes | Mailtrap |
@alexify/mailer/maileroo | MailerooTransport, createMailerooConfig and its error classes | Maileroo |
@alexify/mailer/lettermint | LettermintTransport, createLettermintConfig and its error classes | Lettermint |
@alexify/mailer/plunk | PlunkTransport | Plunk |
@alexify/mailer/postmark | PostmarkTransport | Postmark |
@alexify/mailer/brevo | BrevoTransport | Brevo |
@alexify/mailer/mailjet | MailjetTransport | Mailjet |
@alexify/mailer/mailersend | MailerSendTransport | MailerSend |
@alexify/mailer/sparkpost | SparkPostTransport | SparkPost |
@alexify/mailer/zeptomail | ZeptoMailTransport | ZeptoMail |
@alexify/mailer/smtp2go | Smtp2goTransport | SMTP2GO |
@alexify/mailer/azure | AzureTransport | Azure Communication Services |
@alexify/mailer/scaleway | ScalewayTransport | Scaleway |
@alexify/mailer/cloudflare | CloudflareTransport | Cloudflare |
@alexify/mailer/jmap | JmapTransport, createJmapConfig, JmapApiError, JMAP_ERROR_TYPES, isCapabilityError, uploadBlob | JMAP |
@alexify/mailer/mock | MockTransport | Mock |
@alexify/mailer/pool | PoolTransport, RoundRobinStrategy, WeightedStrategy, PriorityStrategy, SelectorStrategy | Pool |
@alexify/mailer/retry | RetryTransport, createRetryTransport | Retry |
@alexify/mailer/otel | OpenTelemetryTransport, createOpenTelemetryTransport, createEmailAttributeExtractor, createErrorClassifier, defaultErrorClassifier, instrumentHandler | OpenTelemetry |
@alexify/mailer/logger | LoggerTransport | Logger |
@alexify/mailer/breaker | CircuitBreakerTransport | Circuit breaker |
@alexify/mailer/ratelimit | RateLimitTransport | Rate limit |
@alexify/mailer/idempotency | IdempotencyTransport, createMemoryIdempotencyStore | Idempotency |
@alexify/mailer/hooks | HooksTransport | Hooks |
@alexify/mailer/tee | TeeTransport | Tee |
The types of each subpath (configurations, receipts with provider details, the structural TracerProvider, MeterProvider and Logger of the decorators) are in its index.d.ts, next to the code in src/<subpath>/.