🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@anchan828/nest-sendgrid

Package Overview
Dependencies
Maintainers
0
Versions
312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anchan828/nest-sendgrid

SendGrid module for Nest framework (node.js)

0.8.7
Source
npm
Version published
Weekly downloads
4.5K
4.18%
Maintainers
0
Weekly downloads
 
Created
Source

@anchan828/nest-sendgrid

Supported Versions

  • NestJS 8: v0.5.x
  • NestJS 9: v0.6.x

Description

The @sendgrid/mail module for Nest.

This module is very simple.

Installation

$ npm i --save @anchan828/nest-sendgrid

Quick Start

import { SendGridModule } from "@anchan828/nest-sendgrid";
import { Module } from "@nestjs/common";
import { AppController } from "./app.controller";
import { AppService } from "./app.service";

@Module({
  imports: [
    SendGridModule.forRoot({
      apikey: process.env.SENDGRID_API_KEY,
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
import { SendGridService } from "@anchan828/nest-sendgrid";
import { Controller, Post } from "@nestjs/common";

@Controller()
export class AppController {
  constructor(private readonly sendGrid: SendGridService) {}

  @Post()
  async root(): Promise<void> {
    await this.sendGrid.send({
      to: "test@example.com",
      from: "test@example.com",
      subject: "Sending with SendGrid is Fun",
      text: "and easy to do anywhere, even with Node.js",
      html: "<strong>and easy to do anywhere, even with Node.js</strong>",
    });
  }
}

License

MIT.

FAQs

Package last updated on 16 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts