Question:
I am trying to customize the message sent to the user pre-verification by using the custom message trigger, I verified that the data returned from the lambda is valid and the modifications are as I want them to be, however it seems that those changes are not taking any effect as I get the standard verification details to my email
I failed to find any solutions in aws docs, anyone had the same issue ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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) } |
Answer:
It seems that in the cognito panel under message customizations verification type code needs to be checked (not link), after I did that the trigger does change the message