Translate

Tuesday, December 23, 2014

Including dynamic content in your email

In the emerging competitive market, contextual data is used for advertising. Email is a primary tool used by digital marketers and there has been a paradigm shift in the emails sent nowadays. Often we get marketing emails that include dynamic content like location, device, timing, real time weather, social, stock information, a countdown timer for an event or a sale etc. The information is refreshed every time the email is opened.

Recently I was working on such a requirement for a client and figured out how this is done. It is really simple! All we need is to generate a HTML email containing an image, something like below:

<html>
  <body>
    <img src=”http://www.example.com”/>
  </body>
</html>

The image referred in the email content must be hosted on a server. Dynamic images can be created in real-time so that each user gets unique content based on the time/location of open. The technology driving the creation of image rests on a server, so no Javascript or Flash is required at the client side. The action is persistent, so if the user reopens the same email at later time, the content updates. Note that, Dynamic images are supported in all email clients including mobile, wherever images are enabled.

Let’s take a sample scenario. Assume your email is about a hotel/flight reservation confirmation and you intend to include weather forecast of the destination. Whenever the email is opened, the latest weather forecast should be displayed. In this case, your server side code should fetch the weather details (lots of online web services are available for this) and generate a dynamic graphic out of it. This graphic would be sent as the HTTP response back to the caller (email client).

Since a HTTP call is made to fetch the graphic image, the server can make use of the “X-Forwarded-For” HTTP request header to get caller’s IP address and resolve it for the geolocation data. This can be used to deliver location specific content to the user.

For more details on creating HTML Emails, refer below: