Skip to content
v2.278.0

UserPoolEmail Class ​

Configure how Cognito sends emails.

Example ​

ts
new cognito.UserPool(this, 'myuserpool', {
  email: cognito.UserPoolEmail.withSES({
    fromEmail: 'noreply@myawesomeapp.com',
    fromName: 'Awesome App',
    replyTo: 'support@myawesomeapp.com',
  }),
});
python
cognito.UserPool(self, "myuserpool",
    email=cognito.UserPoolEmail.with_ses(
        from_email="noreply@myawesomeapp.com",
        from_name="Awesome App",
        reply_to="support@myawesomeapp.com"
    )
)
java
UserPool.Builder.create(this, "myuserpool")
        .email(UserPoolEmail.withSES(UserPoolSESOptions.builder()
                .fromEmail("noreply@myawesomeapp.com")
                .fromName("Awesome App")
                .replyTo("support@myawesomeapp.com")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new UserPool(this, "myuserpool", new UserPoolProps {
    Email = UserPoolEmail.WithSES(new UserPoolSESOptions {
        FromEmail = "noreply@myawesomeapp.com",
        FromName = "Awesome App",
        ReplyTo = "support@myawesomeapp.com"
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
cognito.NewUserPool(this, jsii.String("myuserpool"), &UserPoolProps{
	Email: cognito.UserPoolEmail_WithSES(&UserPoolSESOptions{
		FromEmail: jsii.String("noreply@myawesomeapp.com"),
		FromName: jsii.String("Awesome App"),
		ReplyTo: jsii.String("support@myawesomeapp.com"),
	}),
})

Initializer ​

ts
new UserPoolEmail()
python
UserPoolEmail()
java
new UserPoolEmail()
csharp
new UserPoolEmail()
go
NewUserPoolEmail()

Methods ​

withCognito(replyTo?: string): UserPoolEmail // chainable@staticmethod def with_cognito(reply_to: typing.Optional[str] = None) -> UserPoolEmailpublic static UserPoolEmail withCognito(String replyTo)public static UserPoolEmail WithCognito(string? replyTo = null)func WithCognito(ReplyTo *string) UserPoolEmail static #
Send email using Cognito.
withSES(options: UserPoolSESOptions): UserPoolEmail // chainable@staticmethod def with_ses(options: UserPoolSESOptions) -> UserPoolEmailpublic static UserPoolEmail withSES(UserPoolSESOptions options)public static UserPoolEmail WithSES(UserPoolSESOptions options)func WithSES(Options UserPoolSESOptions) UserPoolEmail static #
Send email using SES.