@@ -0,0 +1,1497 @@
+const fs = require('fs')%0Aconst path = require('path')%0A%0Aconst AwsService = require('../services/AwsService')%0Aconst awsService = new AwsService(require('aws-sdk'))%0A%0Aconst Request = require('./Request')%0Aconst Response = require('./Response')%0A%0Aconst config = require('../../config.json')%0A%0Amodule.exports.handle = (event, context, callback) =%3E %7B%0A  const request = new Request(event)%0A  request.validate()%0A    .then(function () %7B%0A      const payload = %7Brecipients: request.recipients, userParameters: request.userParameters%7D%0A      return awsService.invokeLambda(config.SERVICE_NAME, config.STAGE, 'send', payload)%0A    %7D)%0A    .then(function () %7B%0A      const statusCode = request.redirectUrl ? 302 : 200%0A      const message = config.MSG_RECEIVE_SUCCESS %7C%7C 'Form submission successfully made.'%0A      return Promise.resolve(new Response(statusCode, message))%0A    %7D)%0A    .catch(function (error) %7B%0A      const response = new Response(error.statusCode, error.message)%0A      return Promise.resolve(response)%0A    %7D)%0A    .then(function (response) %7B%0A      if (request.redirectUrl) %7B%0A        callback(null, response.buildRedirect(request.redirectUrl))%0A        return%0A      %7D%0A      if (request.responseFormat === 'json') %7B%0A        callback(null, response.buildJson())%0A        return%0A      %7D%0A      if (request.responseFormat === 'html') %7B%0A        const template = fs.readFileSync(path.resolve(__dirname, 'template.html')).toString()%0A        callback(null, response.buildHtml(template))%0A        return%0A      %7D%0A    %7D)%0A%7D%0A

add receive handler