发送订单/轨迹消息(网页插件)

注意:网页插件旧版文档,仅供备份使用!

如果您的网页支持在移动端浏览,且您需要当访客点击移动端的联系客服按钮时,自动向客服系统发送订单或轨迹消息,可以使用定制开发模式,并在easemobim.config方法下配置extMsg参数。

自动发送订单消息的示例如下:

<script>
window.easemobim = window.easemobim || {};
easemobim.config = {
    //租户id 
    tenantId: '',   
    //环信客服云域,固定值,请按照示例配置
    domain: '//kefu.easemob.com',                    
    //您网站上im.html文件的完整路径
    path: '//www.yourdomain.com/kefu-webim-plugin_47.16.1',       
    //访客插件static的路径
    staticPath: '//www.yourdomain.com/kefu-webim-plugin_47.16.1/static'  
    //移动端点击联系客服按钮自动发送订单消息demo
    extMsg: {                                   
        "imageName": "mallImage3.png",
        //custom代表自定义消息,无需修改
        "type": "custom",                       
        "msgtype": {
            "order": {
                "img_url": "h\n.pn",
                "title": "订单消息",
                "desc": "端午节粽子四",
                "order_title":"订单号:123456789012345678901234567890",
                "price": "",
                "item_url": "https://www.baidu.com?s=order_sn/123123"
            }
        }
    }
};
</script>
<script src='//www.yourdomain.com/kefu-webim-plugin_47.16.1/easemob.js'></script>

自动发送轨迹消息的示例如下:

<script>
window.easemobim = window.easemobim || {};
easemobim.config = {
    //租户id 
    tenantId: '',   
    //环信客服云域,固定值,请按照示例配置
    domain: '//kefu.easemob.com',                    
    //您网站上im.html文件的完整路径
    path: '//www.yourdomain.com/kefu-webim-plugin_47.16.1',       
    //访客插件static的路径
    staticPath: '//www.yourdomain.com/kefu-webim-plugin_47.16.1/static'  
    //移动端点击联系客服按钮自动发送订单消息demo
    extMsg: {                                   
        "imageName": "mallImage3.png",
        //custom代表自定义消息,无需修改
        "type": "custom",           
        "msgtype": {
            "track":{
                "title":"我正在看:",
                "price":"¥: 235.00",
                "desc":"女装小香风气质蕾丝假两件短袖",
                "img_url":"https://www.yourdomain.com/img/a.jpg",
                "item_url":"https://www.yourdomain.com/item/a.html"
            }
        }
    }
};
</script>
<script src='//www.yourdomain.com/kefu-webim-plugin_47.16.1/easemob.js'></script>