How to setup custom email template for confirmation email of cognito password reset flow?

0

I want to use custom email template for password reset confirmation from cognito. Once password reset api is called, cognito sends out confirmation email to verified user email. The email is so simple and it has nothing but confirmation number. I want to put link to change password and images, text describe our business to our user. If I can get a reset password event, then I can use lambda to handle our custom reset password email.

Thanks.

1回答
0

Hello,

Thank you for posting on AWS re:Post!

I understood that you would like to customize the confirmation email getting sent on password reset to the user.

You can implement this by using custom message lambda trigger, This trigger will get invoked when forgot password action performed. You can refer below AWS reference document for more information on custom message lambda trigger.

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-message.html

Cognito natively doesn't send password reset link it only sends verification code. However, you can use event that is getting sent to custom message lambda trigger to build the password reset link in below format.

https://yourwebsitedomain/forgot-password?confirmation_code=${event.request.codeParameter}&user_name=${event.userName}

In this case, you need to use custom UI where user will enter new password. On submission of the new password, extract user name and confirmation code from URL query parameter and new password from user input. Use ConfirmForgotPassword API with userpool client ID and extracted parameters to reset the password.

I hope this information will be helpful to you.

Thank you!!

AWS
サポートエンジニア
回答済み 8ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ