15.1. Problem

We need to track and collect some metrics on the messages sent. Specifically, we want to know how many people opened the message, that is, read the email; how many clicked on links and which links were clicked; as well as who clicked which links.

There are two problems that we have to solve here. The first problem is figuring out how to track if the user opened the email. We cannot run JavaScript on the recipient's email client because most email clients (if not all) do not allow script execution. The second problem is figuring out how to track hyperlinks to know who clicked a link and what link they clicked.

Some of these metrics can only be measured if the email sent is in HTML format, so we will not get 100 percent reporting, but since most people receive HTML-formatted email, the missing data should be insignificant.

Get ASP.NET MVC 1.0 Test Driven Development: Problem - Design - Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.