Wondering what’s next for npm?Check out our public roadmap! »

@nextnm/nestjs-sesTypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

NestJS SES (AWS emails)

NPM Version Package License NPM Downloads

Introduction

This is a simple wrapper of node-ses. It only comtemplates the send email functionality, but later it will be added more. Just ping me or open pull request and contribute :)

Installation

npm install @nextnm/nestjs-ses

Usage

Importing module

import { SesModule } from '@nextm/nestjs-ses';
@Module({
  imports: [
    SesModule.forRoot({
      SECRET: '<YOUR SECRET>',
      AKI_KEY: '<YOUR AKI_KEY>',
      REGION: 'eu-west-1',
    }),
  ],
  providers: [],
  exports: [],
})
export class YourModule {}

Interfaces

interface EmailOptions {
  from: string;
  to: string;
  subject: string;
  html?: string;
  replyTo?: string;
  cc: string;
  bcc: string[];
  altText?: string;
}

Calling Send Method

import { SesService } from '@nextm/nestjs-ses';
import { SesEmailOptions } from '@nextm/nestjs-ses'
 
@Injectable()
export class YourService {
  constructor(private sesService: SesService) {
    const options: SesEmailOptions = {
      from:'',
      to:'',
      subject:'',
      html:'',
      replyTo:'',
      cc:'',
      bcc:'',
      altText:'',
    };
 
    await this.sesService.sendEmail(options);
  }

Contributing

Contributions welcome! See Contributing.

Notes

This project is not endorsed by or affiliated with AWS.

Author

Nuno Carvalhão Site

License

Licensed under the MIT License - see the LICENSE file for details.

Install

npm i @nextnm/nestjs-ses

DownloadsWeekly Downloads

135

Version

0.0.2

License

MIT

Unpacked Size

419 kB

Total Files

24

Last publish

Collaborators

  • avatar