Skip to content

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 the Message, MessageConstructor, MessageContent, Address, Attachment and Priority types, with the ListFields, ListUrl and MessageTracking of the list and tracking fields; 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, VerifiableTransport and TransportOptions types; isRawTransport, isVerifiableTransport, combineSignals. See custom transports.
  • Receipts: the Receipt and ReceiptError types; createFailedReceipt, createReceiptError, classifyHttpStatus, classifyReceiptError, parseRetryAfter.
  • Raw messages: the RawMessage type; createRawMessagePlan, iterateRawMessage, analyzeRawMessage, RawMessageValidationError.
  • Delivery events: the DeliveryEvent, DeliveryEventType and DeliveryBounce types, which ./webhooks gives. See webhooks and events.
  • The reliability layer: the QueueDriver, QueueSource, QueueJob, QueueJobRequest, QueueOutcome and QueueHandler types every driver shares, and MessageState, AuditEvent and AuditSink, as types only. See the queue and the audit.

Subpaths ​

SubpathExportsPage
@alexify/mailer/mimecomposeMessage, MimeAttachmentReplayErrorMIME
@alexify/mailer/attachmentsfromPath, fromUrl, fromDataUri, fromStream, inlineDataUrls, isPublicUrlAttachments
@alexify/mailer/renderrenderContent, renderFields, createReactEmailRenderer, htmlToTextRendering templates
@alexify/mailer/templatescreateTemplateRenderer, createFileLoader, createMemoryLoader, createCssInliner, createEjsEngine, createHandlebarsEngine, createPugEngine, createMjmlEngine, createLiquidEngine, createNunjucksEngine, createEtaEngine, createMustacheEngine, createReactEmailEngine, TemplateNotFoundError, TemplateRenderError, TemplateLoadErrorTemplates by name
@alexify/mailer/queuecreateMailQueue, createMailJobHandler, createMemoryQueue, createPollingDriver, prepareMailJob, parseMailJob, MailQueueError, QueueLeaseLostError, MAIL_JOB_NAME, MAIL_JOB_VERSIONThe queue
@alexify/mailer/bullmqcreateBullMQDriver, createBullMQProcessor, createBullMQBackoffStrategy, MAILER_BACKOFF_TYPEBullMQ
@alexify/mailer/mongodbcreateMongoOutbox, createMongoAuditSink, createMongoIdempotencyStoreMongoDB outbox
@alexify/mailer/auditcreateMemoryAuditSink, createLoggerAuditSink, combineAuditSinks, stateOf, stateOfDeliveryEvent, auditEventOfDeliveryEvent, isFinalStateThe audit
@alexify/mailer/webhookscreateSesWebhookVerifier, createResendWebhookVerifier, createSendGridWebhookVerifier, createMailgunWebhookVerifier, createPostmarkWebhookVerifier, createMailerSendWebhookVerifier, createMailtrapWebhookVerifier, createBrevoWebhookVerifier, createMailjetWebhookVerifier, createSparkPostWebhookVerifier, createLettermintWebhookVerifier, createMailerooWebhookVerifier, createSmtp2goWebhookVerifier, createAzureWebhookVerifier, createScalewayWebhookVerifier, createMemoryReplayStore, WebhookVerificationErrorWebhooks
@alexify/mailer/smtpSmtpTransport and its error classes (SmtpResponseError, SmtpAuthError, …), isSmtpResponseProviderDetails, createHttpProxyConnectorSMTP
@alexify/mailer/sendmailSendmailTransportSendmail
@alexify/mailer/sesSesTransportAmazon SES
@alexify/mailer/resendResendTransportResend
@alexify/mailer/sendgridSendGridTransport, SendGridApiErrorSendGrid
@alexify/mailer/mailgunMailgunTransport, MailgunApiErrorMailgun
@alexify/mailer/mailtrapMailtrapTransport, createMailtrapConfig and its error classesMailtrap
@alexify/mailer/mailerooMailerooTransport, createMailerooConfig and its error classesMaileroo
@alexify/mailer/lettermintLettermintTransport, createLettermintConfig and its error classesLettermint
@alexify/mailer/plunkPlunkTransportPlunk
@alexify/mailer/postmarkPostmarkTransportPostmark
@alexify/mailer/brevoBrevoTransportBrevo
@alexify/mailer/mailjetMailjetTransportMailjet
@alexify/mailer/mailersendMailerSendTransportMailerSend
@alexify/mailer/sparkpostSparkPostTransportSparkPost
@alexify/mailer/zeptomailZeptoMailTransportZeptoMail
@alexify/mailer/smtp2goSmtp2goTransportSMTP2GO
@alexify/mailer/azureAzureTransportAzure Communication Services
@alexify/mailer/scalewayScalewayTransportScaleway
@alexify/mailer/cloudflareCloudflareTransportCloudflare
@alexify/mailer/jmapJmapTransport, createJmapConfig, JmapApiError, JMAP_ERROR_TYPES, isCapabilityError, uploadBlobJMAP
@alexify/mailer/mockMockTransportMock
@alexify/mailer/poolPoolTransport, RoundRobinStrategy, WeightedStrategy, PriorityStrategy, SelectorStrategyPool
@alexify/mailer/retryRetryTransport, createRetryTransportRetry
@alexify/mailer/otelOpenTelemetryTransport, createOpenTelemetryTransport, createEmailAttributeExtractor, createErrorClassifier, defaultErrorClassifier, instrumentHandlerOpenTelemetry
@alexify/mailer/loggerLoggerTransportLogger
@alexify/mailer/breakerCircuitBreakerTransportCircuit breaker
@alexify/mailer/ratelimitRateLimitTransportRate limit
@alexify/mailer/idempotencyIdempotencyTransport, createMemoryIdempotencyStoreIdempotency
@alexify/mailer/hooksHooksTransportHooks
@alexify/mailer/teeTeeTransportTee

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>/.

Released under the MIT License.