House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

CFMail Problem

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jillian Carroll
07/04/2003 08:58 AM

I'm trying to create an e-mail report for some course administrators.  I've got things figured out so that I can output the results, and I'm getting the correct results... but I only want each administrator to get a single e-mail... my current output would have them getting one for each student. *** *** *** My query (generates the proper results): <cfquery name="users" datasource="#DSN#"> SELECT  users.id AS users_id,     attendee.id AS attendee_id,     users.*,     attendee.*,     courses.*,     organizations.* FROM    users,     attendee,     courses,     organizations WHERE    users.attendee = 'Yes'     AND users.id = attendee.users_id     AND ((users.designation = 'R.T.') OR (users.designation = 'Pharm.D.'))     AND ((attendee.writtentest1 > 70) OR (attendee.writtentest2 > 70) OR (attendee.writtentest3 > 70))     AND ((attendee.skilltest1 = 'Yes') OR (attendee.skilltest2 = 'Yes') OR (attendee.skilltest3 = 'Yes'))     AND ((attendee.assignrec1 = 'Yes') AND (attendee.assignrec2 = 'Yes') AND (attendee.assignrec3 = 'Yes') AND (attendee.pretest = 'Yes'))     AND attendee.assigneddate = courses.id     AND organizations.id = courses.org </cfquery> *** *** *** This loops correctly through the admin responsible for that 'user'... <cfloop query="users">   <cfquery name="ceu_needed" datasource="#DSN#">   SELECT  org_admin.users_id,       org_admin.org_id,       users.id,       users.email   FROM    org_admin       INNER JOIN users ON org_admin.users_id = users.id   WHERE    org_admin.org_id = #users.org#   </cfquery>      <cfoutput>   #ceu_needed.org_id# - #ceu_needed.email#   </cfoutput>   <br /><br />   <cfoutput>   #users.lname#, #users.fname#   <br />#users.address#   <br />#users.city#, #users.prov#  #users.country#  #users.pcode#   <br /><br />   </cfoutput> </cfloop> *** *** *** How can I translate the above query into a CFMAIL Tag so that each admin only gets 1 e-mail? <cfmail TO="#ceu_needed.email#"   FROM="ceu_notice@domain.org"   SUBJECT="CEU Notice"   SERVER="mail.domain.org"   TYPE="html"   QUERY="users"> The following individuals meet the requirements CEU Notice requirements, and do not have a CEU date noted in their user record: <cfoutput> #lname#, #fname# <br />#address# <br />#city#, #prov#  #country#  #pcode# </cfoutput> </cfmail>

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Mark Leder
07/04/2003 10:40 AM

Try this: <cfmail TO="#ceu_needed.email#"   FROM="ceu_notice@domain.org"   SUBJECT="CEU Notice"   SERVER="mail.domain.org"   TYPE="html"   QUERY="users"   GROUP="#ceu_needed.email#"   GROUPCASESENSITIVE="no"> Thanks, Mark I'm trying to create an e-mail report for some course administrators.  I've got things figured out so that I can output the results, and I'm getting the correct results... but I only want each administrator to get a single e-mail... my current output would have them getting one for each student. *** *** *** My query (generates the proper results): <cfquery name="users" datasource="#DSN#"> SELECT  users.id AS users_id,     attendee.id AS attendee_id,     users.*,     attendee.*,     courses.*,     organizations.* FROM    users,     attendee,     courses,     organizations WHERE    users.attendee = 'Yes'     AND users.id = attendee.users_id     AND ((users.designation = 'R.T.') OR (users.designation = 'Pharm.D.'))     AND ((attendee.writtentest1 > 70) OR (attendee.writtentest2 > 70) OR (attendee.writtentest3 > 70))     AND ((attendee.skilltest1 = 'Yes') OR (attendee.skilltest2 = 'Yes') OR (attendee.skilltest3 = 'Yes'))     AND ((attendee.assignrec1 = 'Yes') AND (attendee.assignrec2 = 'Yes') AND (attendee.assignrec3 = 'Yes') AND (attendee.pretest = 'Yes'))     AND attendee.assigneddate = courses.id     AND organizations.id = courses.org </cfquery> *** *** *** This loops correctly through the admin responsible for that 'user'... <cfloop query="users">   <cfquery name="ceu_needed" datasource="#DSN#">   SELECT  org_admin.users_id,       org_admin.org_id,       users.id,       users.email   FROM    org_admin       INNER JOIN users ON org_admin.users_id = users.id   WHERE    org_admin.org_id = #users.org#   </cfquery>      <cfoutput>   #ceu_needed.org_id# - #ceu_needed.email#   </cfoutput>   <br /><br />   <cfoutput>   #users.lname#, #users.fname#   <br />#users.address#   <br />#users.city#, #users.prov#  #users.country#  #users.pcode#   <br /><br />   </cfoutput> </cfloop> *** *** *** How can I translate the above query into a CFMAIL Tag so that each admin only gets 1 e-mail? <cfmail TO="#ceu_needed.email#"   FROM="ceu_notice@domain.org"   SUBJECT="CEU Notice"   SERVER="mail.domain.org"   TYPE="html"   QUERY="users"> The following individuals meet the requirements CEU Notice requirements, and do not have a CEU date noted in their user record: <cfoutput> #lname#, #fname# <br />#address# <br />#city#, #prov#  #country#  #pcode# </cfoutput> </cfmail>

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dan Phillips
07/04/2003 10:47 AM

Or if SERVER="mail.domain.org" does not work, use SERVER="localhost" or SERVER="127.0.0.1" Dan Phillips www.CFXHosting.com 1-866-239-4678 dphillips@cfxhosting.com Try this: <cfmail TO="#ceu_needed.email#"   FROM="ceu_notice@domain.org"   SUBJECT="CEU Notice"   SERVER="mail.domain.org"   TYPE="html"   QUERY="users"   GROUP="#ceu_needed.email#"   GROUPCASESENSITIVE="no"> Thanks, Mark I'm trying to create an e-mail report for some course administrators. I've got things figured out so that I can output the results, and I'm getting the correct results... but I only want each administrator to get a single e-mail... my current output would have them getting one for each student. *** *** *** My query (generates the proper results): <cfquery name="users" datasource="#DSN#"> SELECT  users.id AS users_id,     attendee.id AS attendee_id,     users.*,     attendee.*,     courses.*,     organizations.* FROM    users,     attendee,     courses,     organizations WHERE    users.attendee = 'Yes'     AND users.id = attendee.users_id     AND ((users.designation = 'R.T.') OR (users.designation = 'Pharm.D.'))     AND ((attendee.writtentest1 > 70) OR (attendee.writtentest2 > 70) OR (attendee.writtentest3 > 70))     AND ((attendee.skilltest1 = 'Yes') OR (attendee.skilltest2 = 'Yes') OR (attendee.skilltest3 = 'Yes'))     AND ((attendee.assignrec1 = 'Yes') AND (attendee.assignrec2 = 'Yes') AND (attendee.assignrec3 = 'Yes') AND (attendee.pretest = 'Yes'))     AND attendee.assigneddate = courses.id     AND organizations.id = courses.org </cfquery> *** *** *** This loops correctly through the admin responsible for that 'user'... <cfloop query="users">   <cfquery name="ceu_needed" datasource="#DSN#">   SELECT  org_admin.users_id,       org_admin.org_id,       users.id,       users.email   FROM    org_admin       INNER JOIN users ON org_admin.users_id = users.id   WHERE    org_admin.org_id = #users.org#   </cfquery>      <cfoutput>   #ceu_needed.org_id# - #ceu_needed.email#   </cfoutput>   <br /><br />   <cfoutput>   #users.lname#, #users.fname#   <br />#users.address#   <br />#users.city#, #users.prov#  #users.country#  #users.pcode#   <br /><br />   </cfoutput> </cfloop> *** *** *** How can I translate the above query into a CFMAIL Tag so that each admin only gets 1 e-mail? <cfmail TO="#ceu_needed.email#"   FROM="ceu_notice@domain.org"   SUBJECT="CEU Notice"   SERVER="mail.domain.org"   TYPE="html"   QUERY="users"> The following individuals meet the requirements CEU Notice requirements, and do not have a CEU date noted in their user record: <cfoutput> #lname#, #fname# <br />#address# <br />#city#, #prov#  #country#  #pcode# </cfoutput> </cfmail>


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

September 09, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30