Home

Awesome

AWS-SES-Serverless-Example

serverless

This repo is an example of sending email using SES on Lambda invocation. It uses the AWS SES nodeJS SDK to send emails. Various parameters for sending email such as sourceEmail address, destination email address can be specified as body parameter for the Deployed APIGateway URL.

Technical Architecture:

Architecture diagram

Notes on AWS SES

Instructions to deploy:

git clone https://github.com/lakshmantgld/aws-ses-serverless-example.git
cd aws-ses-serverless-example && yarn install or npm install
AWS_SECRET_ACCESS_KEY=<secret-key>
AWS_REGION=<region>
AWS_ACCESS_KEY_ID=<access-key>

The above credentials are required for deploying the Lambda and APIGateway using serverless

{
	"bccEmailAddresses": [],
	"ccEmailAddresses": [],
	"toEmailAddresses": ["****@gmail.com"],
	"bodyData": "Hey test message buddy!! From AWS SES",
	"bodyCharset": "UTF-8",
	"subjectdata": "AWS SES",
	"subjectCharset": "UTF-8",
	"sourceEmail": "****@gmail.com",
	"replyToAddresses": ["****@gmail.com"]
}

Here is the picture of similar invocation made in postman: Post parameters