使用 cognito 時,通常會想要客制化寄信出來的 message
目前的作法
- 因為需要在寄出來的信件中,顯示相關的 customer attribute,目前找到 & 使用的方式為 trigger lambda 的方式
- 修改 trigger 為 “Custom message”
aws cognito-idp update-user-pool --user-pool-id $POOL_ID --lambda-config CustomMessage="arn:aws:lambda:us-west-2:xxxTest"
- Custom message Lambda trigger - Amazon Cognito
- Customizing user pool workflows with Lambda triggers - Amazon Cognito
- spring - Cognito Customise Messages and Include User Attributes - Stack Overflow AWS console 介面中的 Message customizations Tab 無法設定使用 customer attribute
Reference
- Message Customization on Cognito - DEV Community 主要依照這篇來實作
- Custom message Lambda trigger - Amazon Cognito
- How to custom sender Email/SMS with 3rd party in AWS Cognito – Mr. 沙先生
- Send AWS Cognito emails with 3rd party ESPs
- Creating the CustomSMS Trigger in AWS Cognito using lambda | by Abiral Sthapit | Medium
- python - How to send a custom message for CustomMessage_AdminCreateUser trigger? - Stack Overflow 可以參考 TriggerEnum 的作法
- Authentication with AWS Cognito ⋆ Mark McDonnell 可以參考的 terraform example