Advice for re-styling e-mail for timelines
# June 30, 2014 at 1:34 pm
I have been given the task of creating an interactive timeline. I need to be able to click an element that opens a nicely styled preview of an email message. Currently, I can’t find any easy way to consistently grab the various field values (like To: From:, etc)
Has anyone come up with a way to isolate the various field values in an html email message so that they can be styled using CSS ?
I will submit examples if this doesn’t make sense. Thanks for any replies.# July 2, 2014 at 1:16 pm
Source: Sample E-mail To Convert
This is not an email. It is only HTML markup.
Here is a link to my jsfiddle content.
This is an email. Do you need to do this via JS? Is it possible, for example, to parse the email server-side and send JSON to the browser? That would be the simplest, most robust approach.
Do you need to be able to handle multi-part emails? If not, you might be able to split the email into header / body (split on the blank line), and then split the header into individual lines (split on newline) so you can read each name:value (split on colon).
Displaying the body as HTML is risky, since it would allow for code injection. Not sure how to approach that from the client side.
All this is fairly complex, though. There are server-side tools and libraries that could handle it much easier, and much more reliably. Plus, it would be a small fraction of the work.
You must be logged in to reply to this topic.