do what Rich suggested and create all this outside of your CFMail, then just put it in there at the end. either cfsavecontent, or like:
<cfset message = ""> <cfset crlf = "#Chr(13)##Chr(10)#"> <cfloop index="e" from="1" to="#events.RecordCount#"> <cfset message = message & "Title: #events.title[e]#" & crlf> <cfset message = message & "Artform: #events.artform[e]#" & crlf> <cfset message = message & "Startdate: #DateFormat(events.startdate[e], 'dddd mmmm d, yyyy')#" & crlf> <cfset delimiter = " "><cfset nSentences = ListLen(events.description[e], delimiter)><cfif nSentences GTE 25><cfloop index="i" from="1" to="25"> <cfif ListLen(events.description[e], " ") GTE i><cfset message = message & "#ListGetAt(events.description[e], i, " ")#" & crlf> <cfelse><cfbreak></cfif></cfloop></cfif>... <cfset message = message & crlf & crlf> <cfset message = message & "More details:" & crlf> <cfset message = message & "http://test.artsoutheast.co.uk/diarysingle.cfm?diaryid=#events.diaryid[e] #" & crlf> </cfloop> <cfmail from="me" to="you" subject="fish paste"> #message# </cfmail> Duncan Cumming IT Manager http://www.alienationdesign.co.uk mailto:[EMAIL PROTECTED] Tel: 0141 575 9700 Fax: 0141 575 9600 Creative solutions in a technical world ---------------------------------------------------------------------- Get your domain names online from: http://www.alienationdomains.co.uk Reseller options available! ---------------------------------------------------------------------- ---------------------------------------------------------------------- "Ian Westbrook" To: <[EMAIL PROTECTED]> <[EMAIL PROTECTED] cc: eam.net> Subject: Re: [ cf-dev ] cfmail... 07/08/2003 11:19 Please respond to dev almost there... I changed the code to this, and it works fine: <cfloop index="e" from="1" to="#events.RecordCount#"> Title: #events.title[e]# Artform: #events.artform[e]# Startdate: #DateFormat(events.startdate[e], 'dddd mmmm d, yyyy')# <cfset delimiter = " "><cfset nSentences = ListLen(events.description[e], delimiter)><cfif nSentences GTE 25><cfloop index="i" from="1" to="25"> <cfif ListLen(events.description[e], " ") GTE i>#ListGetAt(events.description[e], i, " ")# <cfelse><cfbreak></cfif></cfloop></cfif>... More details: http://test.artsoutheast.co.uk/diarysingle.cfm?diaryid=#events.diaryid[e]# </cfloop> only problem is, I'm getting some CRs appearing out of nowehere (that's why I've closed up all the code up), so this is the output: Title: Don't Look Back Artform: Drama / theatre Startdate: Saturday August 23, 2003 //NB, any easy way to get the st,nd,th after the day number? Journey start times 4.30pm - 6.30pm on all days, 12pm - 2pm May ... which is not exactly intuitive... any ideas? Ian W ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 07, 2003 10:59 AM Subject: Re: [ cf-dev ] cfmail... > > yeah, but there should be! let me get this straight, you're querying to > get a list of users, then you're emailing them. except the code you've > given will only email the user from the first row returned by the query! > unless you've deliberately removed a cfloop or something? > > > Duncan Cumming > IT Manager > > http://www.alienationdesign.co.uk > mailto:[EMAIL PROTECTED] > Tel: 0141 575 9700 > Fax: 0141 575 9600 > > Creative solutions in a technical world > > ---------------------------------------------------------------------- > Get your domain names online from: > http://www.alienationdomains.co.uk > Reseller options available! > ---------------------------------------------------------------------- > ---------------------------------------------------------------------- > > > > "Ian > Westbrook" To: <[EMAIL PROTECTED]> > <[EMAIL PROTECTED] cc: > eam.net> Subject: Re: [ cf-dev ] cfmail... > > 07/08/2003 > 10:53 > Please > respond to > dev > > > > > > > actually that won't quite work. if you're looping through with cfmail > > query="users" > > but I'm _not_ - there's no query="users" in the CFMAIL tag! > > > <CFMAIL > > FROM="[EMAIL PROTECTED]" > > TO="#users.testemail#" > > SUBJECT="Monthly artform listings from ArtSouthEast" > > > > > ?? > > yeah, I thought about looping... I'll give it a go. > > ta > > Ian W > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, August 07, 2003 10:49 AM > Subject: Re: [ cf-dev ] cfmail... > > > > > > actually that won't quite work. if you're looping through with cfmail > > query="users" then you'll need to keep those queries where they are. but > > change the cfoutput on the events query to use cfloop instead. > > > > > > Duncan Cumming > > IT Manager > > > > http://www.alienationdesign.co.uk > > mailto:[EMAIL PROTECTED] > > Tel: 0141 575 9700 > > Fax: 0141 575 9600 > > > > Creative solutions in a technical world > > > > ---------------------------------------------------------------------- > > Get your domain names online from: > > http://www.alienationdomains.co.uk > > Reseller options available! > > ---------------------------------------------------------------------- > > ---------------------------------------------------------------------- > > > > > > > > [EMAIL PROTECTED] > > sign.co.uk To: > <[EMAIL PROTECTED]> > > cc: > > 07/08/2003 10:44 Subject: Re: > [ cf-dev ] cfmail... > > Please respond to dev > > > > > > > > > > > > > > take those queries outside of your cfmail. then put the query="users" on > > the cfmail tag. and change your cfoutput query="events" to use cfloop > > instead. > > > > > > Duncan Cumming > > IT Manager > > > > http://www.alienationdesign.co.uk > > mailto:[EMAIL PROTECTED] > > Tel: 0141 575 9700 > > Fax: 0141 575 9600 > > > > Creative solutions in a technical world > > > > ---------------------------------------------------------------------- > > Get your domain names online from: > > http://www.alienationdomains.co.uk > > Reseller options available! > > ---------------------------------------------------------------------- > > ---------------------------------------------------------------------- > > > > > > > > "Ian > > > > Westbrook" To: "cfug dev list" > > <[EMAIL PROTECTED]> > > <[EMAIL PROTECTED] cc: > > > > eam.net> Subject: [ cf-dev ] > cfmail... > > > > > > 07/08/2003 > > > > 10:36 > > > > Please > > > > respond to > > > > dev > > > > > > > > > > > > > > Hi > > I haven't used CFMAIL for a while (using CF4.5), so have forgotten some > of > > its finer points (if, indeed, I ever knew). I'm using the following code > > (which I admit probably isn' very efficient anyway) to: > > 1/ get all the users who want to receive the monthly mailout > > 2/ find out what artforms they're interested in > > 3/ pull all the events out of the diary for those artforms and mail 'em > out > > > > This is the error I'm getting: > > > > Invalid tag nesting configuration > > > > A query driven CFOUTPUT tag is nested inside a CFMAIL tag that also has a > > QUERY= attribute. This is not allowed. Nesting these tags implies that > you > > want to use grouped processing. However, only the top-level tag can > specify > > the query that drives the processing. > > > > (er, the CFMAIL doesn't have a QUERY="" attribute, but what the heck...) > > and this is the code: > > > > <!-- this is the monthly mailout to users who have requested it of a > Diary> of their artform events --> > > > > <!-- because this script isn't calling Application.cfm so today's date> > needs to be set --> > > <cfset nowdate = CreateODBCDate(Now())> > > > > <cfquery datasource="#dsn#" name="users"> > > SELECT id, username, password, firstname, testemail > > FROM users > > WHERE receiveartform = 'yes' > > </cfquery> > > > > > > <CFMAIL > > FROM="[EMAIL PROTECTED]" > > TO="#users.testemail#" > > SUBJECT="Monthly artform listings from ArtSouthEast" > > > > > > > <cfquery datasource="#dsn#" name="ids"> > > SELECT artformid > > FROM artformjoin > > WHERE userid = #users.id# > > </cfquery> > > > > <cfquery datasource="#dsn#" name="events"> > > SELECT diary.id AS diaryid, diary.directoryid, diary.artform, > diary.title, > > diary.description, diary.startdate, artforms.id AS artformid, > > artforms.artform AS artform, directory.id AS directoryid, directory.town, > > towns.id AS townid, towns.town AS town > > FROM diary, directory, artforms, towns > > WHERE diary.artform = artforms.id > > AND diary.directoryid = directory.id > > AND directory.town = towns.id > > AND > > (( diary.startdate >= #nowdate#) > > OR > > ( diary.enddate >= #nowdate#)) > > AND diary.artform IN (#valuelist(ids.artformid)#) > > ORDER BY diary.startdate > > </cfquery> > > > > Dear #users.firstname# > > > > As you requested, find below all the events in the ArtSouthEast Diary > which > > match your artform preferences. Below each is a link back to the > > ArtSouthEast Diary for more details. > > > > You can change your artform preferences by logging into ArtSouthEast: go > to > > the home page - http://test.artsoutheast.co.uk/index.cfm - and use your > > login details: > > > > username: #users.username# > > password: #users.password# > > > > <cfoutput query="events"> > > Title: #title# > > Artform: #artform# > > Startdate: #startdate# > > <cfset delimiter = " "> > > <cfset nSentences = ListLen(description, delimiter)> > > > > <cfif nSentences GTE 25> > > <cfloop index="i" from="1" to="25"> > > <cfif ListLen(description, " ") GTE i>#ListGetAt(description, i, " > ")# > > <cfelse><!--- no more words ---><cfbreak></cfif> > > </cfloop></cfif>... > > More details: http://test.artsoutheast.co.uk/diarysingle.cfm?diaryid > > =#diaryid# > > > > </cfoutput> > > > > This email has been brought to you by ArtSouthEast, the arts portal for > the > > south and south east of England. Visit at > > http://test.artsoutheast.co.uk/index.cfm > > > > Best regards, > > > > Ian Westbrook, Editor, ArtSouthEast > > [EMAIL PROTECTED] > > > > > > </CFMAIL> > > > > anyone any ideas? > > > > TIA > > > > Ian W > > > > > > > > Ian Westbrook, > > FutureDream Media Limited, > > (W): www.futuredream.net > > (E): [EMAIL PROTECTED] > > (T): +44 (0) 1303 258 985 > > (M): 07939 510 812 > > > > This message may contain information which is legally privileged and/or > > confidential. If you are not the intended recipient, you are hereby > > notified that any unauthorised disclosure, copying, distribution or use > of > > this information is strictly prohibited. Such notification > notwithstanding > > any comments, opinions, information or conclusions expressed in this > > message are those of the originator, not of FutureDream Media Ltd, unless > > otherwise explicitly and independently indicated by an authorised > > representative of FutureDream Media Ltd. > > > > > > > > > > > > -- > > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > For human help, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > -- > > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > For human help, e-mail: [EMAIL PROTECTED] > > > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > For human help, e-mail: [EMAIL PROTECTED] > > > > > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > For human help, e-mail: [EMAIL PROTECTED] > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
