- Node.js (>= 8.11.0)
- npm (>= 5.8.0)
Check engines
field in package.json
- Node.js & npm
- Serverless
- Clone this repo
- Run
npm install
in the repo directory - App is configured via environment variables contained in a file named
.env
. Use the.env.example
file as a template:cp .env.example .env
and enter configuration details. - For other scripts run
npm run
- Verify domain & email
- Create SNS topic & after lambda deployment, add SNS topic as lambda trigger.
- Adjust configuration sets (set SNS topic for
delivery
) - Create S3 bucket, and allow SES actions in bucket policy (Be sure to add
Get
,Put
,Delete
&List
bucket actions) - Create
mail receiving rule sets
(First rule isS3
bucket, second islambda
) - After lambda deployment, go to IAM console, create role with
AWSLambdaFullAccess
&AmazonSESFullAccess
permissions - Important: Copy role
arn
toserverless.yml
config!
IMPORTANT
👉 Be sure that S3 bucket is empty before sending any mails.
- Create
seed
folder - Create
.json
file that represents AWS SES mocked event(mail receiving).
SES event example 👇
{
"Records": [
{
"EventSource": "aws:ses",
"EventVersion": "1.0",
"ses": {
"mail": {
"timestamp": "2020-09-30T06:13:48.251Z",
"source": "<allowed_source_email_address>",
"messageId": "<incoming_message_id>",
"headersTruncated": false
},
"receipt":{
"timestamp": "2020-09-30T06:13:48.251Z",
"processingTimeMillis": 518
}
}
}
]
}
- Invoke lambda function locally by running
npm run invoke:local <path>
serverless deploy
or with shorthandsls deploy