1.0.6 • Published 4 months ago

nestjs-email-logger v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months 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

4 months ago

1.0.5

5 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago