I'm not sure what I've got wrong here, but if I take out the cfloop, the email will send properly. If the cfloop code stays, then the email doesn't get sent.
Can someone take a look for me?
Can someone take a look for me?
Code:
<cfquery name="get_order_details" datasource="#ds#">
SELECT product_id, quantity, item_price
FROM order_details
WHERE order_id = '#page.order_id#'
</cfquery>
<CFMAIL TO="#page.cust_email#" FROM="#page.our_primary_email#" SUBJECT="Confirmation of Your Order." SERVER="#page.mailserv#">
================================================
Order Confirmation
================================================
<cfif isDefined('page.first_name')>#page.first_name#</cfif>, thank you for ordering from us!
ORDER DETAILS:
Price Quantity Model Number Product
----- -------- ------------ -------
<cfset cust_total=0>
<cfloop query="get_order_details">
<cfquery name="get_prod_details" datasource="#ds#">
SELECT model_number, title
FROM products
WHERE product_id = #product_id#
</cfquery>
#item_price# #quantity# #get_prod_details.model_number# #get_prod_details.title#
<cfset cust_total = cust_total + item_price>
</cfloop>
=========
#cust_total#
Please shop with Us Again.
=================================================
=================================================
</CFMAIL>