Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.handler = async(event) => {
- const eventName = event.Records[0].eventName;
- const dynamodbRecord = event.Records[0].dynamodb;
- if (eventName === 'REMOVE') {
- const email = dynamodbRecord.OldImage.email.S;
- console.log("Sending email to : " + email);
- //code to send email
- }
- else {
- console.log("Event is " + eventName + ", Skipping execution");
- }
- const response = {
- statusCode: 200,
- body: JSON.stringify('Success'),
- };
- return response;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement