A
|
Andrew S 1/26/2013 |
Hi. I am also a newbie with software and still learning. However, I do something similar and this is the code I use in the After Record Added event i.e. When a customer places an order (Add Page) |
T
|
tabarin author 1/28/2013 |
Much thanks...let me try and will get back in case I need your help again. Hi. I am also a newbie with software and still learning. However, I do something similar and this is the code I use in the After Record Added event i.e. When a customer places an order (Add Page) There are probably better ways to do this but it works for me. //** Send confirmation email with new data **** $_SESSION["FullName"] = $values["order_name"]; $_SESSION["OrderID"] = $values["orderID"]; $_SESSION["Product"] = $values["order_product"]; $_SESSION["OrderTotal"] = $values["order_total"]; $_SESSION["OrderDelivery"] = $values["order_delivery"]; //email addresses to send email to (I have changed these rather than show real ones $email = "someone@somewhere.co.uk,someoneelse@somewhereelse.co.uk"; $order_email = $values['order_email']; $orderID = $values['orderID']; $order_name = $values['order_name']; $order_address1 = $values['order_address1']; $order_address2 = $values['order_address2']; $order_town = $values['order_town']; $order_pcode = $values['order_pcode']; $order_contact = $values['order_contact']; $order_email = $values['order_email']; $order_product = $values['order_product']; $order_price = $values['order_price']; $order_delivery = $values['order_delivery']; $order_del_price = $values['order_del_price']; $order_total = $values['order_total']; $order_comment = $values['order_comment']; // Provide link straight to the order (domain name changed here) $orderlink = "http://www.domainname.co.uk/orders/Orders_view.php?editid1="; $orderlink = $orderlink . $values['orderID']; // Provide link to edit the order (once again, domain name changed here) $ordereditlink = "http://www.domainname.co.uk/orders/Orders_edit.php?editid1="; $ordereditlink = $ordereditlink . $values['orderID']; // Provide link to invoice for the order $orderinvoicelink = "http://www.domainname.co.uk/orders/Customer_Invoice_view.php?editid1="; $orderinvoicelink = $orderinvoicelink . $values['orderID']; $order_price=number_format($order_price,2); $order_total=number_format($order_total,2); $order_del_price=number_format($order_del_price,2); // The subject $subject = "Order Number $orderID has been submitted"; // The message $message = "Graham,\n\nA free range order has been placed via the website as follows:\n Order Number : $orderID Full name : $order_name Address1 : $order_address1 Address2 : $order_address2 Town : $order_town Postcode : $order_pcode Email : $order_email Telephone : $order_contact Product Ordered : $order_product Product Price : $order_price Delivery Required : $order_delivery Delivery Price : $order_del_price Total Order Price : $order_total Comments : $order_comment View Order here : $orderlink Edit Order here : $ordereditlink Order Invoice here : $orderinvoicelink"; mail($email, $subject, $message, "From: graham@hanroxfarm.co.uk"); // Place event code here. Here I redirect to a custom confirmation page. header("Location: confirm.php"); exit(); |