See Attached Video

I hosted a hardcoded version of the PHP script on my own server for testing. Pay attention to the prices in the video. Notice how it’s the same email.

Slides

https://docs.google.com/a/wayfair.com/presentation/d/1lK51ar7LZdYM-uBvxTDlxPWMMO0OpebCZnbMnHaki8I/edit?usp=sharing

The Problem

We have customers opening emails hours, even days later than when the email first arrives in their inbox. For that reason we usually don’t include prices since they change so often.

The Solution

Display real time product data at the time a customer opens an email and not when we send them an email. We’ll use product prices in this example.

How Does It Work?

We’re able to do this by leveraging the tag. Instead of linking to an external stylesheet we link to a PHP script that returns CSS. The PHP allows us to hit a rest service to get product data and then format that data into CSS using the “content” property.

Where Does it Work?

This is email after all so it’s not going to work everywhere. The only way this can work is if an email client supports the tag. However, in this example we fallback gracefully by simply not showing the prices.

Email Client Support for Link Tags

https://www.campaignmonitor.com/css/link-element/link-in-head/

The Code

https://litmus.com/builder/2b4d121

Litmus Previews

https://litmus.com/checklist/emails/public/e030b05

Next Steps

Most of the work is done. We would need some sort of a cache so we don’t overload the servers. We do something similar for a countdown script in email. That cache is only 5 minutes if I remember correctly. I would assume we could do something similar here but I would say this is the biggest caveat.

Built With

Share this project:
×

Updates