1. Go to this page and download the library: Download pandaxnm/yii2-dingtalk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
//send text msg
Yii::$app->robot->sendTextMsg("I'm a robot!")
//send text msg and @ all
Yii::$app->robot->sendTextMsg("I'm a robot!", '*')
//send text msg and @ some persons
$mobiles = ['13800138000', '13900139000']
Yii::$app->robot->sendTextMsg("I'm a robot!", $mobiles)
//send link msg
Yii::$app->robot->sendLinkMsg('this is title','some text','http://baidu.com','http://xxx.com/1.png');
//send markdown msg
Yii::$app->robot->sendMarkdownMsg("杭州天气", "#### 杭州天气\n 9度,西北风1级,空气良89,相对温度73%");
//send markdown mag and @ all
Yii::$app->robot->sendMarkdownMsg("杭州天气", "#### 杭州天气\n 9度,西北风1级,空气良89,相对温度73%", '*');
//send markdown msg and @ some persons
$mobiles = ['13800138000'];
Yii::$app->robot->sendMarkdownMsg("杭州天气", "#### 杭州天气 @13800138000\n 9度,西北风1级,空气良89,相对温度73%", $mobiles);