Here is part of the code I use to create emails that are sent out monthly. I have removed a lot of code, queries and more of the msg being build, but this should give you an idea. By no means is this the best example . But it does work:
<CFOUTPUT query="Qgetteaminfo" group="team"> -----------------Part of the msg being build--------------------------------------------------------- <CFSET msg ="For Team Members with Fewer than #holdmaxhours# logged for period. #chr(13)##chr(10)# #chr(13)##chr(10)#"> <CFSET msg = msg & "Team: #Qgetteaminfo.team#"> <CFOUTPUT> <CFSET msg = msg & "Team Member: #Qgetteaminfo.memberName#"> </CFOUTPUT> --------Adds to msg------------------------- <CFIF noaction EQ "true"> <CFSET msg = msg &"All Personnel on your team have logged the required minimum hours for the reporting period.#chr(13)##chr(10)#"> </CFIF> </CFOUTPUT> CFMAIL here -----<BR> <cfmail to="emial1" from="fromemail" subject="Logged Hours for Month of: #mon#" > The listed below individuals have logged the indicated hours to I3MP for the Month of: #mon# #dyear#. Please confirm accuracy and provide response NLT 10 days from receipt. Negative response indicates agreement with the hours reported in this email. DO NOT REPLY TO THIS EMAIL. #msg# </cfmail> -----Original Message----- From: Charles Sheehan-Miles <[EMAIL PROTECTED]> To: CF-Talk <cf-talk@houseoffusion.com> Date: Tue, 18 Apr 2006 13:42:01 -0400 Subject: Re: Evaluate vs ? > Sometimes I send out emails through my system which dynamically > generate the content from variables: > > example: > > Last year you gave $#lsnumberformat(lastyear, "9.99")# to support our > work. This year we hope you'll give $#lsnumberformat(lastyear*2, > "9.99")#. > > My mailer routine uses evaluate against the string to parse out those > values, then it is sent out via cfmail inside a loop. If Evaluate() > isn't recommended, is there a better way to do this? Typically this > type of mailing might go out to 10 or 12 thousand emails at once. > > > On 4/18/06 1:29 PM, "Nick de Voil" <[EMAIL PROTECTED]> wrote: > > >> Is there a time when evaluate should be used? > > > > If you want to dynamically build an unpredictable string which > contains > > logic, rather than just variable names, then afaik you can only > invoke the > > logic using Evaluate(). But then again, that's not something that > people > > need to do very often. > > > > Nick > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238035 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54