cognito/ses: "Provided From email address is invalid" when using email address for from_name
What is the problem?
specifying an email address for a from_name parameter results in a broken Cfn parameter for "From".
Reproduction Steps
the following python code (but specific to cognito construct):
user_pool = cognito.UserPool(
self,
.
.
.
email=cognito.UserPoolEmail.with_ses(
ses_region="us-east-1",
from_email="[email protected]",
from_name="[email protected]",
reply_to="[email protected]",
),
This results in the below behavior.
What did you expect to happen?
Simply use the email address as the name.
What actually happened?
resulted in the following Cfn template output:
"EmailConfiguration": {
"EmailSendingAccount": "DEVELOPER",
"From": "[email protected] <someemailaddr",
"ReplyToEmailAddress": "[email protected]",
As you can see the "From" param is malformed likely due to a string manipulation/prune on the from_name cdk value.
CDK CLI Version
1.142.0
Framework Version
No response
Node.js Version
v14.18.1
OS
Linux/Ubuntu 20.04
Language
Python
Language Version
3.8.10
Other information
Now, I know what you're going to say, "Don't put an email address where a name is expected", to which I will direct your attn to exhibit 1: in the AWS console if you navigate to the Messaging tab of the cognito user pool, the FROM sender name clearly shows an email address when configured manually. So, regardless of how strict the heuristics are for CDK/Cfn, they should align with what is allowable in the console. :-)
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.