客服
获取所有在线的客服
添加客服
$app->customer_service->create('foo@test', '客服1');
修改客服
$app->customer_service->update('foo@test', '客服1');
$app->customer_service->delete('foo@test');
设置客服头像
$app->customer_service->setAvatar('foo@test', $avatarPath); // $avatarPath 为本地图片路径,非 URL
获取客服与客户聊天记录
示例:
$records = $app->customer_service->messages('2015-06-07', '2015-06-21', 1, 20000);
主动发送消息给用户
$app->customer_service->message($message)->to($openId)->send();
示例:
$app->customer_service->message('hello')
> ->send();
$app->customer_service->message($message)
> ->from('account@test')
> ->to($openId)
> ->send();
示例:
$app->customer_service->message('hello')
> ->from('kf2001@gh_176331xxxx')
> ->send();
邀请微信用户加入客服
$app->customer_service_session->create('test1@test', 'OPENID');
关闭会话
$app->customer_service_session->close('test1@test', 'OPENID');
获取客户会话状态
$app->customer_service_session->get('OPENID');
获取未接入会话列表
$app->customer_service_session->waiting();