- Le plus récent
- Le plus de votes
- La plupart des commentaires
Hello,
I see that you want to send a custom message to your users when they signup that will contain the link to your website along with the verification code and username. However, you tested using the code given in the doc [1] but it is not working as expected. You found that it is necessary to pass both codeParameter and the linkParameter in the code. Please feel free to correct me in case I misunderstood your concern.
I replicated at my end with the sample code mentioned in the doc [1] and I verified that it is working as expected. I performed some trial and error operations and found when the default configuration of cognito userpool to confirm the user is set with verification link, in that case the custom message lambda gets triggered but only the default verification link is sent by Cognito. However, if the default configuration of cognito userpool to confirm the user is set with verification code then the sample code works fine and the verification code is sent as per the lambda trigger. Please follow the below steps to verify the configuration of the userpool:
- Open the desired Cognito userpool.
- Go to “Messaging” section
- At the bottom, go to “Message templates” section
- Select “Verification message” and click on edit
- Select verification type as “Code” (if not selected previously)
- Save Changes.
Once the above configuration has been done, go to “Userpool properties” section and attach the sample lambda function as Custom message Lambda trigger. Now, when the user sign-up, the lambda will get triggered and the verification code will be sent to the user with the email format mentioned in the sample code.
Note: there is no requirement for the linkParameter with the above steps.
You can modify the sample code as per your requirements. Also, would like to inform you that if you are using Custom message Lambda trigger then CustomMessage_SignUp is the only trigger source to send the confirmation code post sign-up. Otherwise CustomMessage_ResendCode is the trigger to resend the confirmation code.
I hope the information provided above, proves helpful in addressing your queries. Should you have any further queries, please feel free to reach out to us, we would be more than glad to assist you in all possible ways!
Happy Cloud Computing!
——————————RESOURCES—————————
Contenus pertinents
- demandé il y a 3 mois
- demandé il y a un an
- demandé il y a 19 jours
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 6 mois
Thank you very much. Changing the verification type to "Code" was the solution. Maybe calling that out as a requirement in the documentation with the sample code could provide better direction for others that might run into this issue.