Skip to content
v2.278.0

UserInvitationConfig Struct ​

User pool configuration when administrators sign users up.

Example ​

ts
new cognito.UserPool(this, 'myuserpool', {
  // ...
  userInvitation: {
    emailSubject: 'Invite to join our awesome app!',
    emailBody: 'Hello {username}, you have been invited to join our awesome app! Your temporary password is {####}',
    smsMessage: 'Hello {username}, your temporary password for our awesome app is {####}',
  },
});
python
cognito.UserPool(self, "myuserpool",
    # ...
    user_invitation=cognito.UserInvitationConfig(
        email_subject="Invite to join our awesome app!",
        email_body="Hello {username}, you have been invited to join our awesome app! Your temporary password is {####}",
        sms_message="Hello {username}, your temporary password for our awesome app is {####}"
    )
)
java
UserPool.Builder.create(this, "myuserpool")
        // ...
        .userInvitation(UserInvitationConfig.builder()
                .emailSubject("Invite to join our awesome app!")
                .emailBody("Hello {username}, you have been invited to join our awesome app! Your temporary password is {####}")
                .smsMessage("Hello {username}, your temporary password for our awesome app is {####}")
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new UserPool(this, "myuserpool", new UserPoolProps {
    // ...
    UserInvitation = new UserInvitationConfig {
        EmailSubject = "Invite to join our awesome app!",
        EmailBody = "Hello {username}, you have been invited to join our awesome app! Your temporary password is {####}",
        SmsMessage = "Hello {username}, your temporary password for our awesome app is {####}"
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
cognito.NewUserPool(this, jsii.String("myuserpool"), &UserPoolProps{
	// ...
	UserInvitation: &UserInvitationConfig{
		EmailSubject: jsii.String("Invite to join our awesome app!"),
		EmailBody: jsii.String("Hello {username}, you have been invited to join our awesome app! Your temporary password is {####}"),
		SmsMessage: jsii.String("Hello {username}, your temporary password for our awesome app is {####}"),
	},
})

Properties ​

emailBodyoptionalstringemail_bodyoptionalstremailBodyoptionalStringEmailBodyoptionalstringEmailBodyoptional*string #
The template to the email body that is sent to the user when an administrator signs them up to the user pool.

Default: 'Your username is {username} and temporary password is {####}.'

emailSubjectoptionalstringemail_subjectoptionalstremailSubjectoptionalStringEmailSubjectoptionalstringEmailSubjectoptional*string #
The template to the email subject that is sent to the user when an administrator signs them up to the user pool.

Default: 'Your temporary password'

smsMessageoptionalstringsms_messageoptionalstrsmsMessageoptionalStringSmsMessageoptionalstringSmsMessageoptional*string #
The template to the SMS message that is sent to the user when an administrator signs them up to the user pool.

Default: 'Your username is {username} and temporary password is {####}'