Skip to content

Commit 1dbfa14

Browse files
authored
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*
1 parent b1e3dfd commit 1dbfa14

12 files changed

+526
-4
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-link-custom-placeholder.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-link-custom-placeholder.js.snapshot/integ-user-pool-link-custom-placeholder.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"Resources": {
3+
"myuserpool01998219": {
4+
"Type": "AWS::Cognito::UserPool",
5+
"Properties": {
6+
"AccountRecoverySetting": {
7+
"RecoveryMechanisms": [
8+
{
9+
"Name": "verified_phone_number",
10+
"Priority": 1
11+
},
12+
{
13+
"Name": "verified_email",
14+
"Priority": 2
15+
}
16+
]
17+
},
18+
"AdminCreateUserConfig": {
19+
"AllowAdminCreateUserOnly": true
20+
},
21+
"DeletionProtection": "INACTIVE",
22+
"SmsVerificationMessage": "The verification code to your new account is {####}",
23+
"UserPoolName": "MyUserPool",
24+
"VerificationMessageTemplate": {
25+
"DefaultEmailOption": "CONFIRM_WITH_LINK",
26+
"EmailMessageByLink": "You have been invited to join our awesome app! {##Click here to verify your email##}",
27+
"EmailSubjectByLink": "Invite to join our awesome app!",
28+
"SmsMessage": "The verification code to your new account is {####}"
29+
}
30+
},
31+
"UpdateReplacePolicy": "Delete",
32+
"DeletionPolicy": "Delete"
33+
}
34+
},
35+
"Outputs": {
36+
"userpoolid": {
37+
"Value": {
38+
"Ref": "myuserpool01998219"
39+
}
40+
}
41+
},
42+
"Parameters": {
43+
"BootstrapVersion": {
44+
"Type": "AWS::SSM::Parameter::Value<String>",
45+
"Default": "/cdk-bootstrap/hnb659fds/version",
46+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
47+
}
48+
},
49+
"Rules": {
50+
"CheckBootstrapVersion": {
51+
"Assertions": [
52+
{
53+
"Assert": {
54+
"Fn::Not": [
55+
{
56+
"Fn::Contains": [
57+
[
58+
"1",
59+
"2",
60+
"3",
61+
"4",
62+
"5"
63+
],
64+
{
65+
"Ref": "BootstrapVersion"
66+
}
67+
]
68+
}
69+
]
70+
},
71+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
72+
}
73+
]
74+
}
75+
}
76+
}

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-link-custom-placeholder.js.snapshot/integ.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-link-custom-placeholder.js.snapshot/manifest.json

+119
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)