|
@@ -77,30 +77,26 @@ function get_goods_price($goods_id,$serve_type_id,$phone_type_id = 0){
|
|
|
return $data;
|
|
|
}
|
|
|
//邮箱推送
|
|
|
-function mail_push($mail_str){
|
|
|
+function mail_push($mail_str,$order_id){
|
|
|
+ //查询订单信息
|
|
|
+ $order_info = Db::name('store_order')->field('goods_id,serve_type,client_tel,client_qq,price_amount,describe,create_at')->where('id',$order_id)->find();
|
|
|
+ $order_info['goods_title'] = Db::name('store_goods')->where('id',$order_info['goods_id'])->value('title');
|
|
|
+ $body = "服务类目:".$order_info['goods_title']."<br/>服务类型:".$order_info['serve_type']."<br/>用户手机:".$order_info['client_tel']."<br/>用户QQ:".$order_info['client_qq']."<br/>订单金额:".$order_info['price_amount']."<br/>附加信息:".$order_info['describe']."<br/>下单时间:".$order_info['create_at'];
|
|
|
require_once env('root_path').'/vendor/aliyunmail/aliyun-php-sdk-core/Config.php';
|
|
|
//需要设置对应的region名称,如华东1(杭州)设为cn-hangzhou,新加坡Region设为ap-southeast-1,澳洲Region设为ap-southeast-2。
|
|
|
$iClientProfile = DefaultProfile::getProfile("cn-hangzhou", "LTAI5tSMNtYuD3TdEkM65fyp", "lcmARfziFDS4PUJ0K7AKTf3Ytl3Z8O");
|
|
|
- //新加坡或澳洲region需要设置服务器地址,华东1(杭州)不需要设置。
|
|
|
- //$iClientProfile::addEndpoint("ap-southeast-1","ap-southeast-1","Dm","dm.ap-southeast-1.aliyuncs.com");
|
|
|
- //$iClientProfile::addEndpoint("ap-southeast-2","ap-southeast-2","Dm","dm.ap-southeast-2.aliyuncs.com");
|
|
|
$client = new DefaultAcsClient($iClientProfile);
|
|
|
$request = new Dm\SingleSendMailRequest();
|
|
|
- //新加坡或澳洲region需要设置SDK的版本,华东1(杭州)不需要设置。
|
|
|
- //$request->setVersion("2017-06-22");
|
|
|
$request->setAccountName("feisu@tsguangsu.com");
|
|
|
$request->setFromAlias("飞速");
|
|
|
$request->setAddressType(1);
|
|
|
$request->setTagName("feisu");
|
|
|
$request->setReplyToAddress("true");
|
|
|
$request->setToAddress($mail_str);
|
|
|
- //可以给多个收件人发送邮件,收件人之间用逗号分开,若调用模板批量发信建议使用BatchSendMailRequest方式
|
|
|
- //$request->setToAddress("邮箱1,邮箱2");
|
|
|
- $request->setSubject("新订单通知");
|
|
|
- $request->setHtmlBody("你有新的订单,你请及时处理");
|
|
|
+ $request->setSubject("新订单通知,请及时处理");
|
|
|
+ $request->setHtmlBody($body);
|
|
|
try {
|
|
|
- $response = $client->getAcsResponse($request);
|
|
|
- //print_r($response);
|
|
|
+ $client->getAcsResponse($request);
|
|
|
}
|
|
|
catch (ClientException $e) {
|
|
|
print_r($e->getErrorCode());
|