1.0.6 • Published 1 year ago

nestjs-email-logger v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Nest.js email logger

Installation

npm install nestjs-email-logger

or

yarn add nestjs-email-logger

Configuration

You will need to import the following modules in the main.js file:

import { NotFoundExceptionFilter, LoggerInterceptor } from 'nestjs-email-logger';

And after that you have to configure your app to use those modules globally. Receivers and sender are optional arrays.

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.useGlobalInterceptors(new LoggerInterceptor("Project Name", [receivers], sender));
  app.useGlobalFilters(new NotFoundExceptionFilter("Project Name", [receivers], sender));
  await app.listen(process.env.PORT || 3000);
}

Finally, you will need to set the following env variables with your SendGrid API key:

SG_API_KEY="YOUR_API_KEY"

If you are in DEV environment and you do not want to send emails, you can set the following env variable:

PREVENT_EMAIL_SEND="true"

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago