Skip to main content
November 26, 2008
Question

Help with CFMAIL QUERY?

  • November 26, 2008
  • 1 reply
  • 441 views
Greetings

On my final leg of getting a notification system up and running, I have run into lookup table/junction table discombobulation.

I want a notification message to go out to only those who match a code.

The codes reside in the lookup_code table, the email addresses reside in the lookup_contact table, the main vendors table is related to both the contacts and junction_vendor_code tables via FK's.

The body of the email must pull information from the main bid table for the descriptions:

<p>The following Bid Package has been posted:</p>

<p>#ReferenceNumber#, #Title#, #Description#</p>
etc.


<cfquery name="list_sendto" datasource="#Request.BaseDSN#">
SELECT vendors.vendor_ID, lookup_contact.vendor_ID, contact_email, ReferenceNumber,Title,Description
FROM vendors, lookup_contact, junction_vendor_code, bid
WHERE ???
</cfquery>

<cfmail query="list_sendto"
to="#list_sendto.contact_email#"

etc.

The first mail was supposed to go to one vendor contact, but went out the the whole list of vendor contacts twice.

Thanks for any help and happy Thanksgiving...

newportri


This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
November 27, 2008
The first mail was supposed to go to one vendor contact, but went out the the whole list of vendor contacts twice.
It means the where-clause is satisfied by more than one row. Use <cfdump var="#list_sendto#"> to verify this.