Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. exports.handler = async(event) => {
  2.  
  3. const eventName = event.Records[0].eventName;
  4. const dynamodbRecord = event.Records[0].dynamodb;
  5.  
  6. if (eventName === 'REMOVE') {
  7.  
  8. const email = dynamodbRecord.OldImage.email.S;
  9. console.log("Sending email to : " + email);
  10.  
  11. //code to send email
  12.  
  13. }
  14. else {
  15. console.log("Event is " + eventName + ", Skipping execution");
  16. }
  17.  
  18. const response = {
  19. statusCode: 200,
  20. body: JSON.stringify('Success'),
  21. };
  22. return response;
  23. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement