Welcome to the first installment of my reviews of entries in the Best of ColdFusion 10 contest. If you attended cfObjective last week, then you know this ended up as a good news/bad news type situation. The number of entries were relatively low - 4. The quality of the entries though were high. Personally - I do these contests because I love to see what people build. It's fun. So no matter how many people find the time to participate, I consider it a net win for all of us. With that out of the way, let's look at our first entry, the HTML Email Utility by some dude named Ben Nadel.
If you've ever worked in HTML email, then you are well aware of the serious limitations imposed on you in regards to styling your content. HTML email is so limited it makes IE6 look like a sexy browser. One of the most critical things you can't do in HTML email is supply a style sheet. So instead of having a nice block of CSS declarations, you must use inline style sheets.
Ben's utility attempts to simplify this. You provide it "good" HTML (with a style sheet) and it rewrites it to make use of inline styles. This is done using the jsoup library I mentioned before. It makes use of ColdFusion 10's easy Java library loading to include the bits.
He also makes good use of closures within his processing code. Here's a random sample.
Overall - I think this is an incredibly practical application and something I can see using in the future. Want to try it? You can hit the Demo button below to run it on my server. You can also watch a demo video Ben created here and get the code from his Github repo here.