Amazon Cognito sends verification code automatically if verification feature activated. In my project, sometimes, I will add users(Signup function in AWS Java SDK) and verify them by AdminConfirmSignup myself, so I do not want them to receive verification mail. I will send them customized email manually.(Not using custom lambda in cognito)
If I write pre-signup lambda function and verify the user at that stage, do they still get a verification email?
How can I achieve my goal?
When a user updates their email address or phone number in your app, Amazon Cognito immediately sends a message with a verification code to a user if you configured your user pool to automatically verify that attribute. The user must then provide the code from the verification message to your app.
Short description. You can't change standard user pool attributes after a user pool is created. Instead, create a new user pool with the attributes that you want to require for user registration. Then, migrate existing users to the new user pool by using an AWS Lambda function as a user migration trigger.
Using pre-signup
Lambda trigger you can auto-confirm the user. In this case they will not get a confirmation email. You can find the pre-signup example with auto confirm in this docs.
Basically, you set the autoConfirmUser
flag to true in the event response.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With