'm trying to email an invoice to the customer after they purchase, as well as a copy to our order desk in office...
Unfortunately the person whos coding I inherited had all the information that's needed in three different queries. What makes it even more frustrating is that it's intermitently worked on and off and now doesn't work at all.
Is there any way to pull the information from all three of the queries into one email form? Rewriting the original queries is not an option for me right now. Any help would be greatly appreciated, I'm feeling rather desperate.
Code is as follows currently:
Unfortunately the person whos coding I inherited had all the information that's needed in three different queries. What makes it even more frustrating is that it's intermitently worked on and off and now doesn't work at all.
Is there any way to pull the information from all three of the queries into one email form? Rewriting the original queries is not an option for me right now. Any help would be greatly appreciated, I'm feeling rather desperate.
Code is as follows currently:
Code:
<cfmail SPOOLENABLE="Yes" from="orderdesk@millerdavis.com" to="#Email#" type="HTML" subject="Your order from MillerDavis.com" cc="orderdesk@millerdavis.com" bcc="annam@millerdavis.com" server="mail.millerdavis.com">
Your order from MillerDavis.com: <br /> <br />
<cfquery name="getShip" datasource="MillerDavis">
Select Shipping
from MDCatCust
Where CustomerID = #form.CustomerID#
</cfquery>
<cfset theShipping = getShip.shipping>
<table border="1" bordercolor="Black" cellspacing="0" cellpadding="4">
<cfoutput query="MakeReceipt1" maxrows="1">
<tr>
<td colspan="4" align="left">
#FirstName# #LastName# #company#
</td>
<td align="right">
#DateFormat(NOW(), "mm-dd-yyyy")#
</td>
</tr>
<tr>
<td align="left">
Email
</td>
<td colspan="4" align="right">
#email#
</td>
</tr>
<tr>
<td colspan="5">
#Ship_Address1#
</td>
</tr>
<cfif #Ship_Address2# neq "">
<tr>
<td colspan="5">
#Ship_Address2#
</td>
</tr>
</cfif>
<tr>
<td colspan="5">
#Ship_City#, #Ship_State# #Ship_Zip#
</td>
</tr>
</cfoutput>
<tr>
<td>
<b>Product No.</b>
</td>
<td>
<b>Item Description</b>
</td>
<td>
<b>Price</b>
</td>
<td>
<b>Quantity</b>
</td>
<td>
<b>Total</b>
</td>
</tr>
<cfoutput query="Makereceipt2">
<tr>
<td>
#formno#
</td>
<td>
#Description#
</td>
<td>
#DollarFormat(ItemPrice)#
</td>
<td>
#Quantity#
</td>
<td>
#DollarFormat(itemPriceTotal)#
</td>
</tr>
</cfoutput>
<tr>
<cfoutput>
<td> </td>
<td>Shipping</td>
<td>#Dollarformat(theShipping)#</td>
<td>1</td>
<td>#Dollarformat(theShipping)#</td>
</cfoutput>
</tr>
<tr>
<td colspan="4" align="left">
<b>Grand Total</b>
</td>
<td>
<cfoutput query="MakeReceipt1" maxrows="1">
#DollarFormat(totalprice)#
</cfoutput>
</td>
</tr>
</table>