How can I monitor the opens, clicks, and bounces from emails that I send using Amazon SES?

Last updated: 2020-04-23

I want to be notified about the following events from emails that I send using Amazon Simple Email Service (Amazon SES):

  • When a recipient opens an email, and how many times recipients open my emails
  • When a recipient clicks a link in the email, and how many times recipients click links in my emails
  • When emails that I send result in a bounce, and how many bounces my emails get

How can I do that?

Short Description

Use Amazon Simple Notification Service (Amazon SNS) to notify you when a recipient opens your email, when a recipient clicks a link in your email, or when your email results in a bounce. Then, use Amazon CloudWatch to track how many times recipients open your emails, how many times they click on links in your emails, and how many bounces your emails get.

Follow these steps to configure Amazon SES, Amazon SNS, and CloudWatch for monitoring email opens, clicks, and bounces:

Note: If you copy multiple recipients in an email, this configuration doesn't show which recipient opened the email.

1.    Create an Amazon SNS topic.

2.    Configure Amazon SES to send information about email clicks, opens, and bounces to the Amazon SNS topic.

3.    Configure Amazon SES to send information about email clicks, opens, and bounces to CloudWatch.

4.    Send a test email to verify the notifications for email opens and clicks.

5.    Send a test email to verify the notifications for bounces.

6.    Check your SNS notifications and CloudWatch metrics.

Note: With this configuration, you receive notifications for every open of an email and every click on a link in the email.

Resolution

Before you begin, be sure that you verified your domain with Amazon SES.

Create an Amazon SNS topic

1.    Open the Amazon SNS console.

2.    Choose Create topic.

3.    For Topic name, enter a name to create a unique identifier for your topic.

4.    For Display name, enter a display name for your topic.

5.    Choose Create topic.

6.    From the Topic details of the topic that you created, choose Create subscription.

7.    For Protocol, select Email-JSON.

8.    For Endpoint, enter the email address where you want to receive notifications.

9.    Choose Create subscription.

10.    From the email address that you specified in step 8, open the subscription confirmation email from Amazon SNS with the subject line "AWS Notification - Subscription Confirmation".

11.    In the subscription confirmation email, open the URL specified as "SubscribeURL" to confirm your subscription.

Configure Amazon SES to send information about email clicks, opens, and bounces to the Amazon SNS topic

1.    Open the Amazon SES console.

2.    In the navigation pane, under Email Sending, choose Configuration Sets.

3.    Choose Create Configuration Set.

4.    For Configuration Set Name, enter a name for your configuration set.

5.    Choose Create Configuration Set.

6.    From the list of configuration sets, select the set that you created.

7.    For Add Destination, select SNS.

8.    For Name, enter a name for the SNS destination.

9.    For Event types, select Click, Open, and Bounce.

10.    For Topic, choose the Amazon SNS topic that you created.

11.    Choose Save.

Configure Amazon SES to send information about email clicks, opens, and bounces to CloudWatch

1.    Open the Amazon SES console.

2.    In the navigation pane, under Email Sending, choose Configuration Sets.

3.    Choose the configuration set that you created.

4.    For Add Destination, select CloudWatch.

5.    For Name, enter a name for the CloudWatch destination.

6.    For Event types, select Click, Open, and Bounce.

7.    For Value Source, select Message Tag.

8.    For Dimension Name, enter the name that you want to use for this metric in CloudWatch. For Default Value, you can enter Null as an example.

9.    Choose Save.

Send a test email to verify the notifications for email opens and clicks

1.    Open the Amazon SES console.

2.    In the navigation pane, under Identity Management, choose Domains.

3.    Select one of your verified domains.

4.    Choose Send a Test Email.

5.    For Email Format, choose Raw.

6.    For From, enter an email address with your verified domain.

7.    For To, enter an email address that you want to use as a test recipient.

8.    For Message, enter text that's similar to the following example. Replace myConfigset with the name of the configuration set that you created. Then, replace Email=Null with the Dimension Name and Default Value (Dimension Name=Default Value) that you entered for the CloudWatch destination in your configuration set.

X-SES-CONFIGURATION-SET: myConfigset
X-SES-MESSAGE-TAGS: Email=NULL
From: test-verified-domain@example.com
To: test-recipient@example.com
Subject: Test email
Content-Type: multipart/alternative;
    boundary="----=_boundary"

------=_boundary
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

This is a test email.

<a href="https://aws.amazon.com/">Amazon Web Services</a>
------=_boundary

9.    Choose Send Test Email.

10.    From your test recipient email address, open the test email and click on the link.

Send a test email to verify the notifications for bounces

Note: Amazon SES has a mailbox simulator that you can use to test bounces. The bounces from the mailbox simulator address aren't counted as part of your account's bounce metrics.

1.    Open the Amazon SES console.

2.    In the navigation pane, under Identity Management, choose Domains.

3.    Select one of your verified domains.

4.    Choose Send a Test Email.

5.    For Email Format, choose Raw.

6.    For From, enter an email address with your verified domain.

7.    For To, enter bounce@simulator.amazonses.com.

8.    For Message, enter text that's similar to the following example. Replace myConfigset with the name of the configuration set that you created. Then, replace Email=Null with the Dimension Name and Default Value (Dimension Name=Default Value) that you entered for the CloudWatch destination in your configuration set.

X-SES-CONFIGURATION-SET: myConfigset
X-SES-MESSAGE-TAGS: Email=NULL
From: test-verified-domain@example.com
To: bounce@simulator.amazonses.com
Subject: Test email
Content-Type: multipart/alternative;
    boundary="----=_boundary"

------=_boundary
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

This is a test email.

<a href="https://aws.amazon.com/">Amazon Web Services</a>
------=_boundary

9.    Choose Send Test Email.

Check your SNS notifications and CloudWatch metrics

1.    Open the inbox of the email address that you used as the endpoint for your Amazon SNS topic subscription. Confirm that you received open, click, and bounce notifications.

2.    Open the CloudWatch console.

3.    In the navigation pane, choose Metrics.

4.    From the All metrics view, choose SES.

5.    Choose the metric that you created.

6.    Verify that the graph shows the test emails that you sent to simulate opens, clicks, and bounces.


Did this article help you?

Anything we could improve?


Need more help?