我正在尝试使用自定义消息触发器自定义发送给用户的消息预验证,我验证了从lambda返回的数据是有效的,修改是我想要的那样,但是这些更改似乎没有任何影响,因为我得到了我的电子邮件的标准验证详细信息
我在aws文档中找不到任何解决方案,有人有同样的问题吗?
package main
import (
"fmt"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
// Handler will handle our request comming from the API gateway
func Handler(event events.CognitoEventUserPoolsCustomMessage) (events.CognitoEventUserPoolsCustomMessage, error) {
if event.TriggerSource == "CustomMessage_SignUp" {
event.Response.EmailMessage = "Welcome to myapp, please click the following link to verify your email, this is a custom message"
event.Response.EmailMessage = fmt.Sprintf(`Please click the link below to verify your email address. https://apigateway.myapp.com/auth/validate?client_id=%s&user_name=%s&confirmation_code=%s`, event.CallerContext.ClientID, event.UserName, event.Request.CodeParameter)
}
return event, nil
}
func main() {
lambda.Start(Handler)
}发布于 2020-01-06 05:04:35
似乎在消息自定义验证类型代码下的认知面板中需要检查(而不是链接),在我检查之后,触发器确实更改了消息
发布于 2021-10-15 07:58:34
它也适用于验证链接,但是您必须在用户池消息定制设置中使用code参数作为{##Verify email##},而不是{####}。然后还可以在html模板中使用{##Verify email##}关键字。
https://stackoverflow.com/questions/59603960
复制相似问题