@forinda/kickjs-mailer 1.2.12 → 1.3.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.
Files changed (2) hide show
  1. package/README.md +60 -0
  2. package/package.json +28 -5
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # @forinda/kickjs-mailer
2
+
3
+ Pluggable email sending for KickJS — SMTP, Resend, SES, and custom providers.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ # Using the KickJS CLI (recommended — auto-installs peer dependencies)
9
+ kick add mailer
10
+
11
+ # Manual install
12
+ pnpm add @forinda/kickjs-mailer nodemailer
13
+ ```
14
+
15
+ ## Features
16
+
17
+ - `MailerAdapter` — lifecycle adapter that registers the mailer in DI
18
+ - `MailerService` — injectable service for sending email
19
+ - Built-in providers: `SmtpProvider` (nodemailer), `ConsoleProvider` (dev logging)
20
+ - `MAILER` token for DI injection
21
+ - Pluggable `MailProvider` interface for custom transports (Resend, SES, etc.)
22
+
23
+ ## Quick Example
24
+
25
+ ```typescript
26
+ import { MailerAdapter, SmtpProvider, ConsoleProvider } from '@forinda/kickjs-mailer'
27
+
28
+ bootstrap({
29
+ modules,
30
+ adapters: [
31
+ new MailerAdapter({
32
+ provider: process.env.NODE_ENV === 'production'
33
+ ? new SmtpProvider({ host: 'smtp.example.com', port: 587, auth: { user: '...', pass: '...' } })
34
+ : new ConsoleProvider(),
35
+ }),
36
+ ],
37
+ })
38
+
39
+ // In a service
40
+ @Service()
41
+ class NotifyService {
42
+ @Inject(MAILER) private mailer!: MailerService
43
+
44
+ async sendWelcome(email: string) {
45
+ await this.mailer.send({
46
+ to: email,
47
+ subject: 'Welcome!',
48
+ html: '<h1>Welcome to our app</h1>',
49
+ })
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Documentation
55
+
56
+ [Full documentation](https://forinda.github.io/kick-js/guide/mailer)
57
+
58
+ ## License
59
+
60
+ MIT
package/package.json CHANGED
@@ -1,18 +1,41 @@
1
1
  {
2
2
  "name": "@forinda/kickjs-mailer",
3
- "version": "1.2.12",
3
+ "version": "1.3.0",
4
4
  "description": "Pluggable email sending for KickJS — nodemailer, Resend, SES, and custom providers",
5
5
  "keywords": [
6
6
  "kickjs",
7
- "mailer",
7
+ "nodejs",
8
+ "typescript",
9
+ "express",
10
+ "decorators",
11
+ "dependency-injection",
12
+ "backend",
13
+ "api",
14
+ "framework",
8
15
  "email",
9
16
  "nodemailer",
10
17
  "resend",
11
18
  "ses",
12
19
  "smtp",
20
+ "sendgrid",
13
21
  "templates",
14
- "typescript",
15
- "adapter"
22
+ "@forinda/kickjs-core",
23
+ "@forinda/kickjs-http",
24
+ "@forinda/kickjs-config",
25
+ "@forinda/kickjs-cli",
26
+ "@forinda/kickjs-swagger",
27
+ "@forinda/kickjs-testing",
28
+ "@forinda/kickjs-prisma",
29
+ "@forinda/kickjs-ws",
30
+ "@forinda/kickjs-drizzle",
31
+ "@forinda/kickjs-otel",
32
+ "@forinda/kickjs-graphql",
33
+ "@forinda/kickjs-auth",
34
+ "@forinda/kickjs-cron",
35
+ "@forinda/kickjs-queue",
36
+ "@forinda/kickjs-multi-tenant",
37
+ "@forinda/kickjs-devtools",
38
+ "@forinda/kickjs-notifications"
16
39
  ],
17
40
  "type": "module",
18
41
  "main": "dist/index.js",
@@ -28,7 +51,7 @@
28
51
  ],
29
52
  "dependencies": {
30
53
  "reflect-metadata": "^0.2.2",
31
- "@forinda/kickjs-core": "1.2.12"
54
+ "@forinda/kickjs-core": "1.3.0"
32
55
  },
33
56
  "peerDependencies": {
34
57
  "nodemailer": ">=7.0.11"