Cognito 忽略默认电子邮件验证类型

问题描述 投票:0回答:1

我使用 CloudFormation 模板的以下相关部分创建了一个用户池:

VerificationMessageTemplate:
  DefaultEmailOption: CONFIRM_WITH_LINK
  EmailMessageByLink: Click {##here##} to verify this email address for your account.
  EmailSubjectByLink: Your Verification Link

当我登录控制台时,我看到“验证类型:链接”已正确选择,并且电子邮件主题和消息已正确创建。

但是,当我使用 Amplify 拨打电话

Auth.verifyCurrentUserAttribute('email')
时,Cognito 会向用户发送一封默认电子邮件,其中包含验证码而不是链接。

我是否遗漏了什么? Cognito 是否有理由忽略此设置?

amazon-web-services aws-cloudformation amazon-cognito
1个回答
0
投票

将 EmailMessageByLink 更改为 EmailMessage

将 EmailSubjectByLink 更改为 EmailSubject

VerificationMessageTemplate:
  DefaultEmailOption: CONFIRM_WITH_LINK
  EmailSubject: your subject
  EmailMessage: <a href="{##Verify Email##}">Click the link to verify your email</a>.
© www.soinside.com 2019 - 2024. All rights reserved.