ruslidev/yii2-wablas
Composer 安装命令:
composer require ruslidev/yii2-wablas
包简介
Yii2 Extension for https://wablas.com
README 文档
README
Yii2 Extension for https://wablas.com/
Usage
To use this extension, simply add the following code in your application configuration:
//... 'waBlast' => [ 'class' => \ruslidev\wablas\WablasClient::className(), 'wablasEndpoint' => getenv('WABLAS_ENDPOINT'), 'apiToken' => getenv('WABLAS_API_TOKEN'), ], //...
Default config:
WABLAS_ENDPOINT=https://wablas.com/ WABLAS_API_TOKEN=123456
You can then send an whatsapp as follows:
Send Message
$message = 'Hello...'; $phone_number = '08xxxxx' $result = Yii::$app->waBlast->sendMessage($message,'08xxxxxx'); if($result instanceof StreamInterface){ $resultContent = json_decode($result->getContents()); $message = $resultContent->data->message[0]; }
Send Image
$phone_number = '08xxxxx'
$result = Yii::$app->waBlast->sendImage($imageCaption, $phone_number,$imageUrl ,$secret = false, $priority = false, $type = 'random');
if($result instanceof StreamInterface){
$resultContent = json_decode($result->getContents());
}
Send Document Url
$phone_number = '08xxxxx'
$result = Yii::$app->waBlast->sendDocumentUrl($docUrl, $phone_number = null , $secret = false, $priority = false, $type = 'random');
if($result instanceof StreamInterface){
$resultContent = json_decode($result->getContents());
}
Send Document File
$phone_number = '08xxxxx' $result = Yii::$app->waBlast->sendDocumentFile($file, $phone_number = null, $secret = false, $priority = false, $type = 'random'); if($result instanceof StreamInterface){ $resultContent = json_decode($result->getContents()); }
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-03-05