Skip to content

Instantly share code, notes, and snippets.

@pbzona
Last active October 3, 2017 18:01
Show Gist options
  • Save pbzona/a3f56785862327043175ea930b1a61f9 to your computer and use it in GitHub Desktop.
Save pbzona/a3f56785862327043175ea930b1a61f9 to your computer and use it in GitHub Desktop.
Boilerplate code for serverless contact form
'use strict';
console.log('Loading function');
const AWS = require('aws-sdk');
const sesClient = new AWS.SES();
/**
* Lambda to process HTTP POST for contact form with the following body
* {
"Email": <contact-email>,
"Subject": <contact-subject>,
"Message": <contact-message>
}
*
*/
exports.handler = (event, context, callback) => {
console.log('Received event:', JSON.stringify(event, null, 2));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment