mailery 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ yarn add mailery
14
14
  npm install mailery
15
15
  ```
16
16
 
17
- Peer-dependencies (host-provided): `express ^4 || ^5`. Runtime deps brought in by mailery: `mongodb`, `bullmq`, `ioredis`, `mjml`, `handlebars`, `@sendgrid/mail`, `zod`.
17
+ Peer dependencies (host-provided): `express ^4 || ^5` plus one queue driver — either `bullmq` + `ioredis` (default) or `agenda` + `@agendajs/mongo-backend` + `bottleneck`. Runtime deps brought in by mailery: `mongodb`, `mjml`, `handlebars`, `@sendgrid/mail`, `zod`.
18
18
 
19
19
  ## Quickstart
20
20
 
@@ -44,7 +44,7 @@ const adapter = new MongoContactAdapter({
44
44
  const mailer = await Mailer.init({
45
45
  db,
46
46
  adapter,
47
- redis: { url: process.env.REDIS_URL! },
47
+ queue: { driver: 'bull', redis: { url: process.env.REDIS_URL! } },
48
48
  providers: {
49
49
  sendgrid: new SendGridProvider({
50
50
  apiKey: process.env.SENDGRID_API_KEY!,
@@ -73,7 +73,7 @@ Run a separate worker process for queue jobs:
73
73
 
74
74
  ```ts
75
75
  const mailer = await Mailer.init({ /* same config */ })
76
- await mailer.startWorkers() // BullMQ consumers
76
+ await mailer.startWorkers() // queue consumers (Bull or Agenda, per your queue.driver)
77
77
  ```
78
78
 
79
79
  See [`examples/express-mongo/`](./examples/express-mongo) for a complete working example.
@@ -85,7 +85,7 @@ A self-hosted library you `npm install` into your Express + MongoDB app. Fire ev
85
85
  - **Embedded, not external.** No third-party sync, no per-contact pricing.
86
86
  - **Both transactional and marketing in one engine.** Right defaults per kind (suppression scope, sender identity, circuit-breaker behavior).
87
87
  - **Provider-agnostic.** SendGrid + NullProvider ship; Postmark / SES / Resend pluggable.
88
- - **BullMQ + Redis** for queue + delayed-job scheduling.
88
+ - **Pluggable queue** — BullMQ + Redis (default) or Agenda + Mongo (no Redis required).
89
89
  - **MJML** templates with click + open tracking, plain-text auto-derivation, scope-aware suppression at send time.
90
90
  - **React admin SPA** (Vite-bundled, served as static assets — no build step in your app).
91
91