Menu
Amazon Cognito
Developer Guide (Version Last Updated: 08/26/2017)

Customizing SMS and Email Verification Messages and User Invitation Messages

In the Message Customizations tab, you can customize:

  • Your SMS MFA message

  • Your SMS and email verification messages

  • The verification type for email—code or link

  • Your user invitation messages

  • From and Reply-To email addresses for emails going through your user pool

Note

The SMS and email verification message templates only appear if you have chosen to require phone number and email verification in the Verifications tab. Similarly, the SMS MFA message template only appears if the MFA setting is REQUIRED or OPTIONAL.

Customizing the SMS Message

You can customize the SMS message for MFA authentication by editing the template under the Do you want to customize your SMS messages? heading.

Important

Your custom message must contain the {####} placeholder, which is replaced with the authentication code before the message is sent.

The maximum length for the message is 140 UTF-8 characters, including the authentication code.

Customizing SMS Verification Messages

You can customize the SMS message for phone number verifications by editing the template under the Do you want to customize your SMS verification messages? heading.

Important

Your custom message must contain the {####} placeholder, which is replaced with the verification code before the message is sent.

The maximum length for the message is 140 UTF-8 characters, including the verification code.

Customizing Email Verification Messages

You can choose the verification type for email verifications: code or link.

You can customize the email subject and message for email address verifications by editing the template under the Do you want to customize your email verification messages? heading.

Important

If you have chosen code as the verification type, your custom message must contain the {####} placeholder, which is replaced with the verification code before the message is sent.

The maximum length for the message is 20,000 UTF-8 characters, including the verification code (if present). HTML tags can be used in these emails.

Customizing User Invitation Messages

You can customize the user invitation message that Amazon Cognito sends to new users via SMS or email by editing the templates under the Do you want to customize your user invitation messages? heading.

Important

Your custom message must contain the {username} and {####} placeholders, which are replaced with the user's username and password before the message is sent.

For SMS, the maximum length is 140 UTF-8 characters, including the verification code. For email, the maximum length for the message is 20,000 UTF-8 characters, including the verification code. HTML tags can be used in these emails.

Customizing Your Email Address

By default, the email messages that Amazon Cognito sends to users in your user pools come from no-reply@verificationemail.com. You can specify custom FROM email addresses and REPLY-TO email addresses to be used instead of no-reply@verificationemail.com.

To customize the FROM email address, choose Add custom FROM address and follow the instructions to verify your Amazon Simple Email Service identity. Choose an AWS Region and an Amazon SES verified identity. For more information, see Verifying Email Addresses and Domains in Amazon SES in the Amazon Simple Email Service Developer Guide.

To customize the REPLY-TO email address, choose Add custom REPLY-TO address and enter a valid email address.

Authorizing Amazon Cognito to Send Amazon SES Email on Your Behalf (from a Custom FROM Email Address)

If you want to send email from a custom FROM email address instead of the default, Amazon Cognito needs your permission to send email messages to your users on behalf of your Amazon SES verified identity. To grant that permission, create a sending authorization policy. For more information, see Using Sending Authorization with Amazon SES in the Amazon Simple Email Service Developer Guide.

The following is an example of an Amazon SES sending authorization policy for Amazon Cognito User Pools. For more examples, see Amazon SES Sending Authorization Policy Examples in the Amazon Simple Email Service Developer Guide.

Note

In this example, the "Sid" value is an arbitrary string that uniquely identifies the statement. For more information about policy syntax, see Amazon SES Sending Authorization Policies in the Amazon Simple Email Service Developer Guide.

Copy
{ "Version": "2008-10-17", "Statement": [ { "Sid": "stmnt1234567891234", "Effect": "Allow", "Principal": { "Service": "cognito-idp.amazonaws.com" }, "Action": [ "ses:SendEmail", "ses:SendRawEmail" ], "Resource": "<your SES identity ARN>" } ] }

The Amazon Cognito console adds this policy for you when you select an Amazon SES identity from the drop-down menu. If you use the CLI or API to configure the user pool, you must attach this policy to your Amazon SES Identity.