Gathering detailed insights and metrics for @veek/nestjs-modules-mailer
Gathering detailed insights and metrics for @veek/nestjs-modules-mailer
Gathering detailed insights and metrics for @veek/nestjs-modules-mailer
Gathering detailed insights and metrics for @veek/nestjs-modules-mailer
📨 A mailer module for Nest framework (node.js)
npm install @veek/nestjs-modules-mailer
Typescript
Module System
Node Version
NPM Version
TypeScript (66.88%)
JavaScript (31.24%)
CSS (0.88%)
Handlebars (0.4%)
Dockerfile (0.26%)
Shell (0.18%)
Pug (0.09%)
EJS (0.08%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
885 Stars
1,549 Commits
180 Forks
8 Watchers
9 Branches
57 Contributors
Updated on Jul 11, 2025
Latest Version
1.3.2
Package Id
@veek/nestjs-modules-mailer@1.3.2
Unpacked Size
39.73 kB
Size
10.98 kB
File Count
46
NPM Version
6.13.4
Node Version
12.14.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A mailer module for Nest framework (node.js) using Nodemailer library
npm install --save @nest-modules/mailer
Import the MailerModule into the root AppModule.
1//app.module.ts 2import { Module } from '@nestjs/common'; 3import { HandlebarsAdapter, MailerModule } from '@nest-modules/mailer'; 4 5@Module({ 6 imports: [ 7 MailerModule.forRoot({ 8 transport: 'smtps://user@domain.com:pass@smtp.domain.com', 9 defaults: { 10 from:'"nest-modules" <modules@nestjs.com>', 11 }, 12 template: { 13 dir: __dirname + '/templates', 14 adapter: new HandlebarsAdapter(), // or new PugAdapter() 15 options: { 16 strict: true, 17 }, 18 }, 19 }), 20 ], 21}) 22export class AppModule {}
Of course, it is possible to use an async configuration:
1//app.module.ts 2import { Module } from '@nestjs/common'; 3import { HandlebarsAdapter, MailerModule } from '@nest-modules/mailer'; 4 5@Module({ 6 imports: [ 7 MailerModule.forRootAsync({ 8 useFactory: () => ({ 9 transport: 'smtps://user@domain.com:pass@smtp.domain.com', 10 defaults: { 11 from:'"nest-modules" <modules@nestjs.com>', 12 }, 13 template: { 14 dir: __dirname + '/templates', 15 adapter: new HandlebarsAdapter(), // or new PugAdapter() 16 options: { 17 strict: true, 18 }, 19 }, 20 }), 21 }), 22 ], 23}) 24export class AppModule {}
Afterwards, MailerService will be available to inject across entire project (without importing any module elsewhere), for example in this way:
1import { Injectable } from '@nestjs/common'; 2import { MailerService } from '@nest-modules/mailer'; 3 4@Injectable() 5export class ExampleService { 6 constructor(private readonly mailerService: MailerService) {} 7}
MailerProvider exports the sendMail()
function to which you can pass the message options (sender, email subject, recipient, body content, etc)
sendMail()
accepts the same fields as nodemailer email message
1import { Injectable } from '@nestjs/common'; 2import { MailerService } from '@nest-modules/mailer'; 3 4@Injectable() 5export class ExampleService { 6 constructor(private readonly mailerService: MailerService) {} 7 8 public example(): void { 9 this 10 .mailerService 11 .sendMail({ 12 to: 'test@nestjs.com', // list of receivers 13 from: 'noreply@nestjs.com', // sender address 14 subject: 'Testing Nest MailerModule ✔', // Subject line 15 text: 'welcome', // plaintext body 16 html: '<b>welcome</b>', // HTML body content 17 }) 18 .then(() => {}) 19 .catch(() => {}); 20 } 21 22 public example2(): void { 23 this 24 .mailerService 25 .sendMail({ 26 to: 'test@nestjs.com', 27 from: 'noreply@nestjs.com', 28 subject: 'Testing Nest Mailermodule with template ✔', 29 template: 'welcome', // The `.pug` or `.hbs` extension is appended automatically. 30 context: { // Data to be sent to template engine. 31 code: 'cf1a3f828287', 32 username: 'john doe', 33 }, 34 }) 35 .then(() => {}) 36 .catch(() => {}); 37 } 38 39 public example3(): void { 40 this 41 .mailerService 42 .sendMail({ 43 to: 'test@nestjs.com', 44 from: 'noreply@nestjs.com', 45 subject: 'Testing Nest Mailermodule with template ✔', 46 template: __dirname + '/welcome', // The `.pug` or `.hbs` extension is appended automatically. 47 context: { // Data to be sent to template engine. 48 code: 'cf1a3f828287', 49 username: 'john doe', 50 }, 51 }) 52 .then(() => {}) 53 .catch(() => {}); 54 } 55}
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 4/9 approved changesets -- score normalized to 4
Reason
security policy file detected
Details
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More