Home › Forums › JavaScript › Advice for re-styling e-mail for timelines
- This topic is empty.
-
AuthorPosts
-
June 30, 2014 at 1:34 pm #174140
jaseinatl
ParticipantI 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.
June 30, 2014 at 1:43 pm #174143__
ParticipantCurrently, I can’t find any easy way to consistently grab the various field values (like To: From:, etc)
You’ll need to explain (at a minimum) where you’re “grabbing” the info from.
June 30, 2014 at 3:08 pm #174153jaseinatl
ParticipantSource: Sample E-mail To Convert
Destination:Example of desired HTML (from email)
@un-traq-ed, thanks for your reply.
July 2, 2014 at 12:48 pm #174392jaseinatl
ParticipantHere is a link to my jsfiddle content. I was hoping it wouldn’t have to come to this:
http://jsfiddle.net/Whirl3d/7Gy7S/2/
I still have to create handlers for different data types (like dates, urls, email addresses, etc)
July 2, 2014 at 1:16 pm #174400__
ParticipantSource: 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.
July 2, 2014 at 2:33 pm #174411jaseinatl
ParticipantThanks for your input. I am deleting this question. I could really care less any more. I will manually convert the 50 or so messages. e-Mail is pathetic.
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.