Created
February 19, 2019 22:08
-
-
Save alexcasalboni/d9a3e12ca8062681b8236275b1c3f612 to your computer and use it in GitHub Desktop.
Amazon Cognito User Pools - Custom Message Hook with AWS Lambda (Node.js)
This file contains hidden or 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
exports.handler = (event, context, callback) => { | |
if(event.userPoolId === "theSpecialUserPool") { | |
// check event type | |
if(event.triggerSource === "CustomMessage_SignUp") { | |
// customize message and subject content | |
event.response.smsMessage = "Welcome to the service. Your confirmation code is " + event.request.codeParameter; | |
event.response.emailSubject = "Welcome to the service"; | |
event.response.emailMessage = "Thank you for signing up. " + event.request.codeParameter + " is your verification code"; | |
} | |
} | |
callback(null, event); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment