ses-builder
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Amazon SES parameter builder

npm package

Easy to create a request object to execute ses.sendEmail.

TOC

Getting started

$ npm i -S ses-builder aws-sdk

Usage

import { SES } from 'aws-sdk'
import SESBuilder from 'ses-builder'
 
const SendMailBuilder = SESBuilder.SendMailFactory.init()
const MailDestinationHelper = SESBuilder.MailDestinationHelper.init()
const MailMessageHelper = SESBuilder.MailMessageHelper.init()
 
// set source
SendMailBuilder.setSource('hoge@example.com')
 
// Set destination
MailDestinationHelper.putToAddresses('hello@example.com')
SendMailBuilder.setDestination(MailDestinationHelper.getDestination())
 
// set message
MailMessageHelper.putBody({
    text: 'hello'
})
SendMailBuilder.setMessage(MailMessageHelper.getMessage())
 
// set reply address
SendMailBuilder.setReplyToAddresses(['hi@example.com'])
 
const ses = new SES()
ses.sendEmail(SendMailBuilder.getParams()).promise()

Testing

$ git clone git@github.com:hideokamoto/ses-builder.git
cd ses-builder
$ npm install
$ npm test -- --watch

API Document

https://hideokamoto.github.io/ses-builder/

Readme

Keywords

none

Package Sidebar

Install

npm i ses-builder

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

41.8 kB

Total Files

17

Last publish

Collaborators

  • hideokamoto