Skip to content

AI Draft

AI-assisted draft. Use this page as the quick orientation layer for the mail package.

@lastshotlabs/slingshot-mail is the event-driven mail delivery package in the Slingshot workspace. It combines three concerns that stay intentionally separate in the code: delivery providers, template renderers, and queues.

The package does not need routes or middleware. Its plugin participates in setupPost, starts the configured queue, optionally validates templates and provider health, and wires event-bus subscriptions into queued mail sends.

  • provider factories such as Resend, SES, Postmark, and SendGrid
  • renderer factories such as raw HTML and React Email
  • queue implementations including an in-memory default and a BullMQ-backed queue
  • subscription wiring from Slingshot events to mail jobs
  • create a provider and renderer, then pass them to createMailPlugin()
  • add subscriptions when mail should react to Slingshot events instead of only being sent manually
  • enable durable subscriptions only when the backing event transport actually supports them

The missing docs gap here is examples. This package needs one clear example per provider or renderer style more than it needs more conceptual prose.