-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cognito): allow custom email msg placeholder (#28832)
When I change the text in the "{##Verify Email##}" placeholder, e.g. to "{##verify your email##}", cdk synth and cdk deploy commands yield the error, ``` Error: Verification email body must contain the template string '{##Verify Email##}' ``` This is incorrect as that documentation states that this string may be customised. https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-email-verification-message-customization.html Help text in the AWS Cognito console reads: You can customize this message with HTML. "Verify email" is the text that will be displayed over the clickable link in the message. You can customize the "Verify email" string, but the variable - some text enclosed by "{##" and "##}" - must be kept in the message. Expected Behavior Be able to change the emailBody property of a UserPool to include the placeholder of format, "{##Verify Your Email##}" with any custom string allowed by AWS Cognito. Closes #23828 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
12 changed files
with
526 additions
and
4 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...k-integ/test/aws-cognito/test/integ.user-pool-link-custom-placeholder.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...l-link-custom-placeholder.js.snapshot/integ-user-pool-link-custom-placeholder.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
...link-custom-placeholder.js.snapshot/integ-user-pool-link-custom-placeholder.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"Resources": { | ||
"myuserpool01998219": { | ||
"Type": "AWS::Cognito::UserPool", | ||
"Properties": { | ||
"AccountRecoverySetting": { | ||
"RecoveryMechanisms": [ | ||
{ | ||
"Name": "verified_phone_number", | ||
"Priority": 1 | ||
}, | ||
{ | ||
"Name": "verified_email", | ||
"Priority": 2 | ||
} | ||
] | ||
}, | ||
"AdminCreateUserConfig": { | ||
"AllowAdminCreateUserOnly": true | ||
}, | ||
"DeletionProtection": "INACTIVE", | ||
"SmsVerificationMessage": "The verification code to your new account is {####}", | ||
"UserPoolName": "MyUserPool", | ||
"VerificationMessageTemplate": { | ||
"DefaultEmailOption": "CONFIRM_WITH_LINK", | ||
"EmailMessageByLink": "You have been invited to join our awesome app! {##Click here to verify your email##}", | ||
"EmailSubjectByLink": "Invite to join our awesome app!", | ||
"SmsMessage": "The verification code to your new account is {####}" | ||
} | ||
}, | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
} | ||
}, | ||
"Outputs": { | ||
"userpoolid": { | ||
"Value": { | ||
"Ref": "myuserpool01998219" | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...nteg/test/aws-cognito/test/integ.user-pool-link-custom-placeholder.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
119 changes: 119 additions & 0 deletions
119
...g/test/aws-cognito/test/integ.user-pool-link-custom-placeholder.js.snapshot/manifest.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.