In the midst of your HTML file, place a string like [[CONTENT]] where you
want the content to go. Then open the file, read it into a variable, and
replace that string with the actual content. 

-----Original Message-----
From: Robert Rawlins [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 06, 2007 8:26 AM
To: CF-Talk
Subject: Creating HTML Content Wrapper for Email

Hello Guys,

I'm building a general utility component for sending emails from my
application, so I can use it for error reporting, contact forms,
newsletters, order confirmations and alike. I'm looking for the best method
to create an HTML wrapper for the content.

At the moment a variable named 'content' which is a plain text string gets
passed into the component, and then fired off from a cfmail using the
default settings for the bean, but what i'd really like to be able to do is
pass in a variable named 'template' or 'wrapper' which is just the path to
an HTML file, which is then used as a wrapper around my standard 'content'.
This would allow me to use different templates from different areas of the
app, without having to hard code the HTML inside my cfc. Inside my HTML I'd
just have a DIV with id="Content" as a placeholder or somthing.

I could pass in two variables 'header' and 'footer' which I could output
adove and below my content, but I'd rather just pass it in as a single file
referance.

I've also considered the use of custom tags but was in the frame of mind
that its bad practiec to use them inside of your model layer as they should
only be used inside the view.

What would you advise?

Thanks chaps,



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271710
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to