# UserPoolEmail

Configure how Cognito sends emails.

Obtainable from: UserPoolEmail.withCognito, UserPoolEmail.withSES

- Source: [`aws-cognito/lib/user-pool-email.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-email.ts#L118)

## Example

TypeScript:

```ts
new cognito.UserPool(this, 'myuserpool', {
  email: cognito.UserPoolEmail.withSES({
    fromEmail: 'noreply@myawesomeapp.com',
    fromName: 'Awesome App',
    replyTo: 'support@myawesomeapp.com',
  }),
});
```

Python:

```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:

```java
UserPool.Builder.create(this, "myuserpool")
        .email(UserPoolEmail.withSES(UserPoolSESOptions.builder()
                .fromEmail("noreply@myawesomeapp.com")
                .fromName("Awesome App")
                .replyTo("support@myawesomeapp.com")
                .build()))
        .build();
```

C# / .NET:

```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"
    })
});
```

Golang:

```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

TypeScript:

```ts
new UserPoolEmail()
```

Python:

```python
UserPoolEmail()
```

Java:

```java
new UserPoolEmail()
```

C# / .NET:

```csharp
new UserPoolEmail()
```

Golang:

```go
NewUserPoolEmail()
```

## Methods

- `withCognito(replyTo?: string): UserPoolEmail // chainable` (static) — Send email using Cognito.

- `withSES(options: UserPoolSESOptions): UserPoolEmail // chainable` (static) — Send email using SES.
