badr Posted October 17, 2005 Posted October 17, 2005 Hi, I installed this contribution manufacturer email v.06. How can I include the shipping service in the mail sended to the manufacturer ? I tried this function manufacturers_email($oID) {// Get the delivery address $delivery_address_query = tep_db_query("select distinct customers_id, customers_company, customers_name, customers_street_address, customers_postcode, customers_city from orders where orders_id='" . $oID ."'") ; $delivery_address_list = tep_db_fetch_array($delivery_address_query) ; // Get all the manufacturers emails to be sent to // Must have an email address and have manufacturers_send_email set to 1 $manufacturers_email_query = tep_db_query("select distinct ot.title, pd.customers_email_address, pd.customers_name, ot.text as order_total FROM products_description pd,orders_total ot, orders_products o, products p where pd.products_id=p.products_id and p.products_id=o.products_id and o.orders_id='" . $oID . "' ORDER BY pd.products_id"); while ($manufacturers_email_list= tep_db_fetch_array($manufacturers_email_query)) { $the_email=$manufacturers_email_list['customers_email_address']; $the_name=$manufacturers_email_list['customers_name']; $email_message = '<br>Pour: <b>' . $the_name . '</b> Email: <b>' . $the_email . '</b><br><br> Provenant de: <b>' . STORE_NAME . '</b><br><br>Vous avez reussi ....:<br>' . $delivery_address_list['customers_company'] .'<br>' . $delivery_address_list['customers_name'] .'<br>' . $delivery_address_list['customers_street_address'] .'<br>' . $delivery_address_list['customers_postcode'] . ' ' . $delivery_address_list['customers_city'] . '<br>' ; // Get all the products for a manufacture to be included in the email $manufacturers_email_products_query = tep_db_query("select ot.title, ot.text, o.orders_id, p.products_id, pd.customers_name, pd.customers_email_address, o.products_name, o.products_model, o.products_id, o.products_price, o.products_quantity, o.orders_products_id FROM orders_total ot, products_description pd, orders_products o, products p where pd.products_id=p.products_id and o.products_id=p.products_id and o.orders_id='" . $oID . "' and pd.customers_email_address='" . $the_email . "' order by o.products_name"); $email_message = $email_message . '<table width="100%" border=1 cellspacing="0" cellpadding="0"> <tr><td>Quantity:</td><td>name:</td><td>Price:</td><td>model:</td></tr>' ; while ($manufacturers_email_products= tep_db_fetch_array($manufacturers_email_products_query)) { $email_message = $email_message . '<tr><td>' . $manufacturers_email_products['products_quantity'] . '</td><td>' . $manufacturers_email_products['products_name'] . '</td><td>' . $manufacturers_email_products['title'] . '</td><td>' . $manufacturers_email_products['text'] . '</td></tr>'; $current_products_id=$manufacturers_email_products['orders_products_id']; $manufacturers_email_products_attributes_query = tep_db_query("select distinct opa.products_options_values from orders_products_attributes opa, orders o where opa.orders_id='" . $oID . "' and opa.orders_products_id='" .$current_products_id . "'"); while ($manufacturers_email_products_attributes= tep_db_fetch_array($manufacturers_email_products_attributes_query)) { $email_message = $email_message . '<tr><td> </td><td colspan=3>'. $manufacturers_email_products_attributes['products_options_values'] .'</td></tr>'; } $email_message = $email_message . '<br>'; } $email_message = $email_message . '</table><br><HR><br>'; //send the email tep_mail($the_name, $the_email, 'F?licitations ...., $email_message, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS) ; } return true; } but this is not good thank you for help. Ps: sorry for my english Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.