Lists are pretty one-dimensional.  They basically just store a single
string at each index (and I don't really like lists in lists).  What you
have is groupings of related data.  (name, e-mail)

I would graduate up to a two-dimensional array or a struct.

Or you could get all kinds of fancy an create an array of structs.  


 <cfset recipient_array = arraynew(1)>
 
 <cfset recipient_array[1] = structnew()>
 <cfset recipient_array[1].name = "bob">
 <cfset recipient_array[1].email = "[email protected]">
 
 <cfset recipient_array[2] = structnew()>
 <cfset recipient_array[2].name = "tom">
 <cfset recipient_array[2].email = "[email protected]">
 
 <cfdump var="#recipient_array#">
 <br><br>
 <cfloop array="#recipient_array#" index="recipient">
     E-mail to #recipient.name# (#recipient.email#)<br>
 </cfloop>
 
Questions to ask yourself: How many names/emails does your interface
allow a person add?   What are the form fields named?  Are names in a
repeatable sequence that will allow me to dynamically loop over them?

~Brad



   -------- Original Message --------
 Subject: Personalizing a CFLoop
 From: "cfcom" <[email protected]>
 Date: Mon, January 05, 2009 1:00 pm
 To: cf-talk <[email protected]>
 
 CFLoop Problem:
 I need to take the contents a visitor enters into our form and use
 it to send out personalized emails to several recipients. How do I set
up
 the cfloop so that it sends a unique email to each recipient,
personalizes
 the opening sentence and ends it signed by the visitor using the form.
So
 far I can loop to each different address but I am having trouble doing
the
 'name/email' pair of variables. 
 
 
 <cfinsert datasource="mynamedsn" tablename="mytablename" 
 formfields="sender_firstname, sender_lastname,
 sender_email, sender_address, sender_city, sender_state, sender_zip,
 sender_time, sender_date, sender_ip, sender_msgType">
 
 
 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317411
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to