TerrenceRyan.com

I'm a 35 year old redhead geek from Philly.
I'm currently a Developer Evangelist for Adobe.
Also the author of Driving Technical Change

CSS + CFMail

1 Comment

A came across the dumb little trick a while back, and wanted to share this.

I like to make the mail sent from an application look like it's part of the application, but often the step is overlooked during the development process. However by using <cfinclude> and CSS, this can be accomplished:

<cfmail to="user@example.com" subject="Yo!" type="HTML" from="anotheruser@example.com"> <style type="text/css"> <cfinclude template="[path to CSS for site]"> </style> [content goes here.] </cfmail>

Granted, you have to make sure that your CSS not huge, or this becomes inefficient.

1 response so far ↓

  • 1 Steve Glachan

    The include is nice a neat way of doing this, especially if your generated newsletter email is long and complex. Wrapping a <savecontent/> around the email content can also be an alternative. Then below it you would just output the 'savecontent' variable between cfmail tags.

Leave a Comment









Categories

Monthly Archives

Tag Cloud

coldfusion web development flex coldfusion builder appearances squidhead coldfusion builder extensions higher ed html5 flash builder air mobile android driving technical change adobe apptacular running a coldfusion shop adobemax06 movable type flash catalyst flash css blackberry adobemax07 adobemax08 hero finicky adobemax09 holy crap i’m a mobile developer centaur phonegap basecamp cfc whichelement unfuddle motorola metablog irrational characters ios git evangelism edge devices code reviews ant wharton subversion security rhino philly philadelphia multidevice knowledge@wharton jobs javascript java browserlab adobemax10 adobe tv unfuddlecfc svnauth.cfc semantic html semantic html responsive web design qnx nlb linux jquery mobile it github flexorg fireworks eclipse dreamweaver apps apple adobemax11