if ($pay_status){
// 設(shè)置郵件的發(fā)件人姓名和Email地址:
$service_mail['email'] = $GLOBALS['_CFG']['service_email']; // 自動讀取客服郵件地址;
$service_mail['sender'] = $GLOBALS['_CFG']['shop_name']; // 自動讀取網(wǎng)店名稱;
// 訂單的基本情況:
$sql = “SELECT pay_status,shipping_name,shipping_fee,
pay_name,consignee,address,zipcode,tel,money_paid
FROM “.$GLOBALS['ecs']->table(’order_info’).”
WHERE order_id = $order_id “;
$order_info = $GLOBALS['db']->getRow($sql);
if ($order_info['pay_status'] == PS_PAYED) $service_mail['status']=’已付款’;
if ($order_info['pay_status'] == PS_PAYING) $service_mail['status']=’已付款到支付寶’;// 貨款暫存于支付寶的狀態(tài);
date_default_timezone_set(’PRC’);
$service_mail['subject'] = “訂單 $order_sn {$service_mail['status']}。”; // 定義郵件的主題;
// 以下是定義郵件的主要內(nèi)容,可以根據(jù)自己的實(shí)際情況調(diào)整:
$service_mail['content'] = date(’Y-m-d H:i’).” 訂單 $order_sn {$service_mail['status']},可以開始發(fā)貨。 rn”;
if ($note){
$service_mail['content'] .= ‘付款留言:’.$note.”rn”;
}
$service_mail['content'] .= “訂單的詳細(xì)情況:rn”;
$service_mail['content'] .= “總金額:{$order_info['money_paid']} 元;rn”;
$service_mail['content'] .= “配送方式:{$order_info['shipping_name']}(配送費(fèi):{$order_info['shipping_fee']})rn”;
$service_mail['content'] .= “付款方式:{$order_info['pay_name']}({$service_mail['status']})rn”;
$service_mail['content'] .= “收貨人:{$order_info['consignee']}rn”;
if ($order_info['zipcode']) $order_info['zipcode'] = ” 郵編:{$order_info['zipcode']}”; else $order_info['zipcode'] = ”;
$service_mail['content'] .= “收貨人地址:{$order_info['address']} {$order_info['zipcode']}rn”;
$service_mail['content'] .= “收貨人電話:{$order_info['tel']}rnrn”;
// 生成商品清單:
$service_mail['content'] .= “訂購商品清單:rn”;
$sql = “SELECT goods_sn,goods_name,goods_number,goods_price
FROM “.$GLOBALS['ecs']->table(’order_goods’).” og, “.$GLOBALS['ecs']->table(’order_info’).” oi
WHERE og.order_id = oi.order_id
AND oi.order_id = $order_id”;
$res = $GLOBALS['db']->getAll($sql);
foreach ($res as $value){
$service_mail['content'] .= “貨號:{$value['goods_sn']}; t商品:{$value['goods_name']}; t數(shù)量:{$value['goods_number']}; rn”;
}
// 發(fā)送郵件:
send_mail($service_mail['sender'], $service_mail['email'], $service_mail['subject'], $service_mail['content'], 0);
}
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: ecshop訂單付款之后向用戶客戶發(fā)送訂單信息確認(rèn)郵件