This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html | |
const AWS = require("aws-sdk"); | |
const ses = new AWS.SES(); | |
// https://aws.amazon.com/premiumsupport/knowledge-center/lambda-send-email-ses/ | |
const SENDER = "Your name <[email protected]>"; | |
function response(status, message) { | |
const res = { | |
isBase64Encoded: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Full example - https://aws.amazon.com/blogs/architecture/create-dynamic-contact-forms-for-s3-static-websites-using-aws-lambda-amazon-api-gateway-and-amazon-ses/ | |
import { SESClient, SendEmailCommand, SendTemplatedEmailCommand } from "@aws-sdk/client-ses"; // need package.json with "type": "module" for import | |
// Set the region (example - us-east-2) | |
const ses = new SESClient({ region: "us-east-2" }); | |
// https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html | |
const SENDER = 'Your verified SES email address'; | |
export const handler = async(event) => { | |
const sendCommand = new SendEmailCommand({ |