Cognito 自定义消息触发器没有任何效果

Sma*_*vic 4 go amazon-web-services amazon-cognito

我正在尝试使用自定义消息触发器自定义发送给用户预验证的消息,我验证了从 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)
}
Run Code Online (Sandbox Code Playgroud)

Sma*_*vic 6

似乎在消息自定义验证类型代码下的认知面板中需要检查(不是链接),在我这样做之后触发器确实改变了消息