github.com/Foodji/aws-lambda-go@v1.20.2/events/README_SES.md (about) 1 2 # Sample Function 3 4 The following is a sample class and Lambda function that receives Amazon SES event message data as input, writes some of the message data to CloudWatch Logs, and responds with a 200 status and the same body as the request. (Note that by default anything written to Console will be logged as CloudWatch Logs events.) 5 6 ```go 7 package main 8 9 import ( 10 "context" 11 "fmt" 12 13 "github.com/aws/aws-lambda-go/events" 14 "github.com/aws/aws-lambda-go/lambda" 15 ) 16 17 func handler(ctx context.Context, sesEvent events.SimpleEmailEvent) error { 18 for _, record := range sesEvent.Records { 19 ses := record.SES 20 fmt.Printf("[%s - %s] Mail = %+v, Receipt = %+v \n", record.EventVersion, record.EventSource, ses.Mail, ses.Receipt) 21 } 22 23 return nil 24 } 25 26 func main() { 27 lambda.Start(handler) 28 } 29 30 ```