this code was just sample stuff, I'm actually grouping on UserID, then
ItemID, in a total of 3 nested cfoutputs, not the 2 given in this example.

But any code at this point here:
<cfoutput query="queryName" group="Username">
     #queryName.EmailAddress#

     <!--- HERE --->

should only repeat for as many different Usernames, ID's or whatever I'm
grouping on.  The bit above it only repeats for each different user.  The
query might return 5 results, for each of the 5 items, but the grouping
should ensure that only 2 users get emailed.  I'm sure CFMail is picking up
the idea that it should have the Query attribute appended on there, as it's
inside a cfoutput query="".  So it's repeating for as many results are
returned from the query, regardless of how the grouping should affect this
bit of code.

I'm going to construct the email in the cfoutput as I am currently (that
works), but only do the sending outwith the cfoutput, which should work.
thanks anyway.


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!
----------------------------------------------------------------------
----------------------------------------------------------------------



                                                                                       
                                    
                    Kevin Faulkner                                                     
                                    
                    <[EMAIL PROTECTED]        To:     "'[EMAIL PROTECTED]'" <[EMAIL 
PROTECTED]>     
                    stems.com>                   cc:                                   
                                    
                                                 Subject:     RE: [ cf-dev ] what's 
wrong with this code?                  
                    11/08/2003 17:41                                                   
                                    
                    Please respond to dev                                              
                                    
                                                                                       
                                    
                                                                                       
                                    



It does look similar to that other query, but I've got into a habit (right
or wrong) of not handling any grouping out of my SQL, so probably would
have
gone about this a slightly different way.

   But from the top of my head, is it because you're not grouping by email
address? As this ought to be as unique as username, it should work the same
but may be handled by CFMAIL better?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 11 August 2003 17:21
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] what's wrong with this code?



Is this related to the problem someone else on the list had not that long
ago, where a CFMail inside a CFOutput thought it had a CFQuery attribute
specified?  Any ideas anyone?


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:

                    11/08/2003 15:24                   Subject:     [
cf-dev
] what's wrong with this code?
                    Please respond to dev








Got a query that returns some rows, with the output grouped.  I'm wanting
to construct a mail message inside the cfoutputs.
Basic idea of the code I've got just now, where I'm simply sending the
email without constructing it properly yet:

<cfquery name="queryName">
     SELECT Username, EmailAddress, ItemName
     FROM Users, Items
     WHERE Users.ID = Items.UserID
     ORDER BY Username, ItemName
</cfquery>

<cfoutput query="queryName" group="Username">
     #queryName.EmailAddress#

     <!--- email the user --->
     <cfmail from="me" to="#queryName.EmailAddress#" subject="test">
          blah
     </cfmail>

     <!--- display their items --->
     <cfoutput>
          - #queryName.ItemName#
     </cfoutput>
</cfoutput>


Sample output on the screen is

[EMAIL PROTECTED]
- Fish
- Paste

[EMAIL PROTECTED]
- Monkey
- Mince
- Cheese

How many emails should I get, two?  In this case I'm getting 5.  It only
displays 2 users, but does 5 cfmails.  Am I being particularly dumb or
something?
[CF 4.5]


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!
----------------------------------------------------------------------
----------------------------------------------------------------------


--
** 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]
DISCLAIMER: This e-mail is confidential and may also be legally privileged.
If you are not the intended recipient, use of the information contained in
this e-mail (including disclosure, copying or distribution) is prohibited
and may be unlawful.  Please inform the sender and delete the message
immediately from your system.  This e-mail is attributed to the sender and
may not necessarily reflect the views of the Patsystems Group and no member
of the Patsystems Group accepts any liability for any action taken in
reliance on the contents of this e-mail (other than where it has a legal or
regulatory obligation to do so) or for the consequences of any computer
viruses which may have been transmitted by this e-mail. The Patsystems
Group
comprises Patsystems plc and its subsidiary group of companies.

--
** 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]

Reply via email to