v1.4.3These docs are for laramail v1.4.3. View changelog

Exports Reference

Everything exported from laramail. The package has two entry points:

ImportUse case
import { ... } from 'laramail'Production and test code
import { ... } from 'laramail/testing'Test-only imports (keeps fake mode out of production bundles)

laramail/testing exports

ExportDescription
MailFakeFake mail provider — stores messages instead of sending
AssertableMessageMessage wrapper with assertion helpers
SentMessageType for stored fake messages

Classes

ExportDescription
MailStatic facade -- configure(), to(), send(), fake(), assertions
MailManagerFactory and manager for mail providers
MailableAbstract base class for reusable email definitions
MessageLow-level message builder with fluent API
FailoverManagerOrchestrates provider failover
SmtpProviderSMTP provider (Nodemailer)
SendGridProviderSendGrid provider
SesProviderAWS SES provider
MailgunProviderMailgun provider
ResendProviderResend provider
PostmarkProviderPostmark provider
LogProviderConsole-logging provider for development
HandlebarsEngineHandlebars template engine
EjsEngineEJS template engine
PugEnginePug template engine
QueueManagerQueue management
BullMQDriverBullMQ queue driver
BullDriverBull (legacy) queue driver
MarkdownRendererMarkdown-to-HTML renderer
MarkdownMailableAbstract mailable with markdown support
MailFakeFake mail provider for testing
AssertableMessageMessage wrapper with assertion helpers
NodeMailErrorBase error class for all laramail errors
ConfigurationErrorThrown for missing/invalid config or dependencies
ValidationErrorThrown for invalid user input (has .field property)
ProviderErrorThrown for runtime provider failures (has .provider property)
AllProvidersFailedErrorThrown when all failover providers fail (has .attempts array)

Functions

ExportDescription
getDefaultTheme()Returns the default MarkdownTheme

Constants

ExportValueDescription
VERSION'1.4.3'Package version

Types

ExportDescription
TemplateEngineTemplate engine interface
TemplateEngineOptionsTemplate engine constructor options
MarkdownRendererOptionsMarkdown renderer options
MarkdownThemeMarkdown theme interface
SentMessageShape of a stored sent message
MailConfigTop-level configuration object
MailerConfigIndividual mailer configuration
SmtpConfigSMTP provider configuration
SendGridConfigSendGrid provider configuration
SesConfigAWS SES provider configuration
MailgunConfigMailgun provider configuration
ResendConfigResend provider configuration
PostmarkConfigPostmark provider configuration
LogConfigLog provider configuration
MailAddressEmail address with optional display name
AttachmentEmail attachment definition
MailOptionsFull mail options for sending
MailProviderProvider interface
MailResponseResponse from sending an email
FailoverConfigFailover chain configuration
FailoverEventFailover callback event data
FailoverDetailIndividual failover attempt detail
QueueConfigQueue system configuration
RedisConnectionConfigRedis connection options
BackoffConfigQueue retry backoff settings
QueuedMailJobQueued mail job definition
QueueJobResultResult of queuing a job
QueueDriverQueue driver interface
TemplateConfigTemplate system configuration
MarkdownConfigMarkdown mail configuration