EasyCFM.COM ColdFusion Forums / Coding Help! / adding dynamic form values to a cfmail

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: adding dynamic form values to a cfmail

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Redmanz
10-16-2002 @ 9:33 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 411
Joined: Oct 2002

I am having a problem trying to pass the following variables into a cfmail
tag. As you can see the form fields are dynamically generated by the length
of the array. This is necessary as we have no idea how many tickets a
particular customer will purchase but still need to harvest information so
we can assign a name and age to each ticket purchased. Also would be nice to
verify the age for example if a Childs ticket is purchased and the purchaser
enters the age 10 script should verify that the number 10 falls between the
ages of say 2 - 11 years of age or if they purchase a senior ticket than the
age should be 65+. If it does not meet that criteria than it would give a
warning. Hope someone can help me with this......been trying all sorts of
different ways and keep bumping into the proverbial brick wall.......Thanks
in advance

The generated fields:

    <cfloop from="1" to="#arrayLen(session.passes)#" index="i">
      <tr>
        <td class="regular" align="right"
bgcolor="##FFFFFF">#session.passes[3]#'s Name #i#: </td>
        <td bgcolor="##FFFFFF">
          <input type="text" name="name_#i#">
        </td>
      </tr>
      <td class="regular" align="right"
bgcolor="##FFFFFF">#session.passes[3]#'s Age #i#: </td>
      <td class="regular" bgcolor="##FFFFFF">
        <input type="text" name="age_#i#"> Must Be: #session.passes[4]#
      </td>
      </tr>
    </cfloop>

Now place these values into the cfmail tag

<cfmail to="MYSTORE@STORE.com" from="#session.passBill.Email#"
subject="Order from website!">

Billing Information:

  Agreed to Terms and Conditions of Sale

  First Name: #session.passBill.FirstName#
  Last Name: #session.passBill.LastName#
  Phone Number:
#session.passBill.phone_1#-#session.passBill.phone_2#-#session.passBill.phon
e_3#
  Email Address: #session.passBill.Email#
  Address Line 1: #session.passBill.Street_Line1#
  Address Line 2: #session.passBill.Street_Line2#
  Address Line 3: #session.passBill.Street_Line3#
  City or Town: #session.passBill.City#
  Postal Code: #session.passBill.PostalCode#
  Province: #session.passBill.stat_prov#
  Country: #session.passBill.Country#

  ===============================================
  <cfloop index="i" from="1" to="#ArrayLen(session.passes)#">
  Name and Ages on Passes:

  ===============================================

  Passtype: #session.passes[1]#
  Number Of Days: #session.passes[2]#
  Age Group: #session.passes[3]#
  ===============================================
  </cfloop>
  Total cost is: #dollarFormat(session.total_cost)#

</cfmail>



Specialization is for Insects!

Webmaster
10-16-2002 @ 10:08 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

OK, I have a couple of questions before I can help you find a solution.


  1. Will there be mutiple emails or just one with all the information in it?
  2. The values:
    First Name: #session.passBill.FirstName#
      Last Name: #session.passBill.LastName#
      Phone Number:
    #session.passBill.phone_1#-#session.passBill.phone_2#-#session.passBill.phon
    e_3#
      Email Address: #session.passBill.Email#
      Address Line 1: #session.passBill.Street_Line1#
      Address Line 2: #session.passBill.Street_Line2#
      Address Line 3: #session.passBill.Street_Line3#
      City or Town: #session.passBill.City#
      Postal Code: #session.passBill.PostalCode#
      Province: #session.passBill.stat_prov#
      Country: #session.passBill.Country#

      Will they always be a single value (as in a single's customer information) or mutiple names and addresses?
  3. If you are trying to send a single email with all the items within the email (Similar to a VIEW SHOPPING CART), let me know too... would simply quite a bit..


Waiting for your reply...


Thanks,
Pablo Varando
EasyCFM.COM, LLC.

Redmanz
10-16-2002 @ 10:15 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 411
Joined: Oct 2002

There will be two emails being sent one to the purchaser and the other to the store owner.

The reason for generating these fields dynamically is we have no idea how many name and age fields will be required. So it is best to assume that there will be more than one set of name and age fields.

Yes this is sort of like a view shopping cart thing.

And lastly thank you for responding so promptly......you are doing the cf world a great service. Smile

Specialization is for Insects!

Webmaster
10-17-2002 @ 10:53 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Wanted to write a brief note, letting you know that I'm working on your solution... will have it shortly Wink

Thanks,
Pablo Varando
EasyCFM.COM, LLC.


Website Designed and Developed by Pablo Varando.