storing dymanic content in the database
I am trying to allow the user to create their own "reports" and I need them to be able to store content with variables names into the database.
for example
A user would type the following information into a multi-line text box and store that in a SQL database field.
Hello, #firstName#, Thank you for contacting us on #contactdate#. If there is anything I can help you with, please contact me at #companyPhone#.
There would then be a page that would look like this:
<cfquery name="getContent" datasource="x">
select usercontent
from contenttable
where id = 1
</cfquery>
<cfquery name="getList" datasource="x">
select firstname, contactdate, email
from userlist
</cfquery>
<cfmail to="#email" from="sales@company.com" subject="Follow up" query="getList">
#getContent.usercontent#
</cfmail>
So basically, I want the email to be compiled from the text that the user enters into the DB, and the variables populated with the correct info.
I've tried playing with the evaluate() and de() fields but I cant get on the right track.
If I use #evaluate(getcontent.usercontent)# I can get it to work, only using 1 variable. I cant get it to work with the whole paragraph of text.
any help would be greatly appreciated.
steve
