Skip to content

Receive multipart/form-data and send email via AWS Lambda

Notifications You must be signed in to change notification settings

mdeck/aws_amp_mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

aws_amp_mailer

This is an AWS Lambda function which receives a contact form and sends it via email. I'm using it in practice to implement a "Contact Us" amp-form on an AMPHTML site. See it live.

It uses AWS Simple Email Service (SES) to transmit the email. In this implementation, both the sender and recipient email addresses are verified through AWS. Thus, there is no need to exit the default SES sandbox. If you use this to directly email other people, you will need to request production access from Amazon.

It uses Python's built-in email.parser lib to parse the input MIME-encoded form data (Content-Type: multipart/form-data).

The lambda should be assigned in API Gateway to a POST resource LAMBDA_PROXY integration request. The method response headers should include Access-Control-Allow-Origin.

Releases

No releases published

Packages

No packages published