Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spreadmonitor/nest-mailer-module

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spreadmonitor/nest-mailer-module

Re-usable NestJS module for sending emails via Mailgun.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
2
Weekly downloads
 
Created
Source

nest-mailgun-module

Build Status codecov

Re-usable NestJS module for sending emails via Mailgun.

Installation

$ npm install @spreadmonitor/nest-mailgun-module

Usage

import { Module } from '@nestjs/common';
import { MailgunModule } from '@spreadmonitor/nest-mailgun-module';

import * as TEMPLATES from './email-templates';

@Module({
  imports: [
    MailgunModule.forRoot({
      templates: TEMPLATES,
      sender: 'Fancy Co. <no-reply@fancy.com>',
      mailgunApiKey: process.env['MAILGUN_API_KEY'],
      mailgunDomain: process.env['MAILGUN_DOMAIN'],
    }),
  ],
  exports: [MailgunModule],
})
export class CoreModule {}
import { SignupService } from '@app/auth/services';
import { MailService } from '@spreadmonitor/nest-mailgun-module';
import { WelcomeTemplate } from '@app/auth/email-templates';

@Controller('auth')
export class SignupController {
  constructor(private readonly signupService: SignupService, private readonly mailService: MailService) {}

  @Post('signup')
  async createAccount(@Body() payload: SignupPayload): string {
    await this.signupService.createAccount();

    await this.mailService.send(payload.email, WelcomeTemplate, {
      name: payload.name,
    });

    return { message: 'Yay! Account created!' };
  }
}

For detailed usage please read the documentation.

Contact

License

This project is licensed under MIT.

FAQs

Package last updated on 15 Jun 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc