@forinda/kickjs-mailer
v1.3.2
Published
Pluggable email sending for KickJS — nodemailer, Resend, SES, and custom providers
Downloads
1,618
Maintainers
Keywords
Readme
@forinda/kickjs-mailer
Pluggable email sending for KickJS — SMTP, Resend, SES, and custom providers.
Install
# Using the KickJS CLI (recommended — auto-installs peer dependencies)
kick add mailer
# Manual install
pnpm add @forinda/kickjs-mailer nodemailerFeatures
MailerAdapter— lifecycle adapter that registers the mailer in DIMailerService— injectable service for sending email- Built-in providers:
SmtpProvider(nodemailer),ConsoleProvider(dev logging) MAILERtoken for DI injection- Pluggable
MailProviderinterface for custom transports (Resend, SES, etc.)
Quick Example
import { MailerAdapter, SmtpProvider, ConsoleProvider } from '@forinda/kickjs-mailer'
bootstrap({
modules,
adapters: [
new MailerAdapter({
provider: process.env.NODE_ENV === 'production'
? new SmtpProvider({ host: 'smtp.example.com', port: 587, auth: { user: '...', pass: '...' } })
: new ConsoleProvider(),
}),
],
})
// In a service
@Service()
class NotifyService {
@Inject(MAILER) private mailer!: MailerService
async sendWelcome(email: string) {
await this.mailer.send({
to: email,
subject: 'Welcome!',
html: '<h1>Welcome to our app</h1>',
})
}
}Documentation
License
MIT
