In our article about Posting Form Content to a Slack Channel via an AWS Lambda Function, we elaborated on how to take advantage of AWS Lambda to handle a delicate process you don’t want to expose to the public in your single-page application.
In this guide, we’ll provide you with an AWS Lambda function for sending an email to a visitor who submitted a form, leaving their email address for registering, downloading a file, getting access to some service or benefit, or something similar. We’ll use AWS SES (Simple Email Service) for sending out the emails, but you might as well use SendGrid, MailChimp, or what you prefer.