@pluzchat/nestjs-ses
v1.0.2
Published
Nest - modern, fast, powerful node.js web framework (@ses)
Downloads
24
Readme
NestJS SES
Table of Contents
Description
Integrates SES with Nest
Installation
npm install @pluzchat/nestjs-ses aws-sdk
You can also use the interactive CLI
SesModule.forRoot(options, connection?)
import { Module } from '@nestjs/common';
import { SesModule } from '@pluzchat/nestjs-ses';
import { AppController } from './app.controller';
@Module({
imports: [
SesModule.forRoot({
config: {
credentials: {
accessKeyId: "Key",
secretAccessKey: "Secret",
},
},
}),
],
controllers: [AppController],
})
export class AppModule {}
SesModule.forRootAsync(options, connection?)
import { Module } from '@nestjs/common';
import { SesModule } from '@pluzchat/nestjs-ses';
import { AppController } from './app.controller';
@Module({
imports: [
SesModule.forRootAsync({
useFactory: () => ({
config: {
credentials: {
accessKeyId: "KEY",
secretAccessKey: "SECRET",
},
},
}),
}),
],
controllers: [AppController],
})
export class AppModule {}
InjectS3(connection?)
import { Controller, Get, } from '@nestjs/common';
import { InjectSES, SES } from '@pluzchat/nestjs-ses';
@Controller()
export class AppController {
constructor(
@InjectSES() private readonly sesSvc: SES,
) {}
@Get()
async getHello() {
var params = {
FailureRedirectionURL: 'STRING_VALUE', /* required */
FromEmailAddress: 'STRING_VALUE', /* required */
SuccessRedirectionURL: 'STRING_VALUE', /* required */
TemplateContent: 'STRING_VALUE', /* required */
TemplateName: 'STRING_VALUE', /* required */
TemplateSubject: 'STRING_VALUE' /* required */
};
this.sesSvc.createCustomVerificationEmailTemplate(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
}
}
License
MIT