Hi,

I'm not sure if this is possible or not. What I want to do is store snippets of 
coldfusion code (for an email template) in a database. I then want to take that 
database record, load it into a variable and then have coldfusion process the 
variable as if it were code that was written in a normal cfm template.

One way that I could do it is to write the code to a .cfm file (using cffile) 
and then read that file back in via a cfinclude to be processed as normal. 
However, I wish to avoid this solution if possible.

An example:
In the database, this is the code that has been stored as text:



<cfoutput>
<p>Dear #buyerrecord.getfirstname()#,<p>
                

<p>Your order has shipped. Your tracking number is 
#orderrecord.gettrackingnumber()#</p>

<p>Thanks,</p>
<p>Your friendly and highly attentive and customer-focused Customer Service 
Representative</p>




This will then be read into a variable (perhaps named emailtemplatecontent) 
which I then wish to execute within <cfmail> tags.

For example:

<cfmail to"[EMAIL PROTECTED]".....>
#emailtemplatecontent#
</cfmail>

Does anybody have any ideas? I've tried loading the variable into 
<cfsavecontent /> variables but it doesn't seem to work. The code that is 
stored in the database record gets output (literally) into the email but the 
code doesn't get executed.

Any help would be greatly appreciated. I hope I've made the problem relatively 
clear.

Thanks,
Tom





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

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

Reply via email to