Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Evaluate

New Here ,
Dec 02, 2008 Dec 02, 2008
I am trying to create an easy way to maintain some emails we sent out on a regular basis. I have setup a table to store the data for the 7 or so emails we have. All the emails have HTML inside them and also has variables that needed to be processed. When I try to evaluate the body of the email (that contains html coding and variables), the evaluate stops at all the "<" signs and gives an error stating that this is the beginning of a cold fusion tag and will not continue.

My question is, how can I evaluate a block of html code with variables needing processed without receiving an error?

Thanks.
508
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2008 Dec 02, 2008
You are probably better off storing the info in files and putting the file locations in your db. Then you can use things like cfsavecontent or cfinclude and things will just work.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2008 Dec 03, 2008
I would rather have all the information pulled from a table on the fly, so editing is very fast and easy - with menus. There ought to be a way to use evaluate with html coding together.

Anyone have any solutions?

Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 03, 2008 Dec 03, 2008
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 05, 2008 Dec 05, 2008
The HTMLEditFormat or the HTMLCodeFormat did not work.

When using the edit - it gave me an error after running into an "&" sign and code gave me an error when running into a "<" sign.

Any other solutions.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 09, 2008 Dec 09, 2008
Still no solution
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 09, 2008 Dec 09, 2008
What happened when you simply outputted the html stuff from your db without trying to evalutate it?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 09, 2008 Dec 09, 2008
LATEST
You need to do as Dan suggested. Store the email bodies in separate files and store the file location in your database. This doesn't prevent you from, as you say:
"...so editing is very fast and easy - with menus."

Just use <cffile> to read and write the contents of the files. And when you're sending your emails, use <cfinclude>

You can't dynamically evaluate coldfusion code, which is what you're trying to do. You want to be able to do something like this:
Evaluate("<b>Hello #firstname#!</b> Thanks for requesting our newsletter!! Today's date is #now()#")
That won't work, as you've found out. The only way to accomplish this currently is to write that string to a file, then <cfinclude> that file.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources