'Want to get Users group in lambda function
I'm creating a custom template to verify email. For this i have created a lambda function in node.js. I need user groups to get role but unable to find in events. Below is my code. I have tried to find a solution but could not get it.
'use strict';
exports.handler = async (event, context, callback) => {
const email = event.request.userAttributes.email;
console.log(context);
console.log(event.request.userAttributes.email);
console.log(event);
const name = event.request.userAttributes.name;
const template = (name) => `<html> </html>`;
if (event.triggerSource === "CustomMessage_SignUp") {
event.response = {
emailSubject: "Activate: Confirm LAGO Account Email",
emailMessage: template(name, link)
};
}
console.log(event.response);
callback(null, event);
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|