emizoripx/whatsapp-cloudapi
最新稳定版本:v1.0.7
Composer 安装命令:
composer require emizoripx/whatsapp-cloudapi
包简介
Library for sending Whatsapp messages with the Whatsapp Cloud Api service
README 文档
README
Package for sending Whatsapp messages with the Whatsapp Cloud Api Service.
Supports
- Send messages with a predefined template.
- Send documents and multimedia.
- Send buttons or links.
- Currently supports sending to a single cell phone number.
Configure
Before use, you must configure the following parameters
- In the
.envfile of the project copy and set the following environment variables
WHATSAPP_CLOUD_API_HOST=
Usage
- To send a message just call the Facade
EmizorIpx\WhatsappMessages\Facades\WhatsappMessageto methodsendWhithTemplateand specify the required parameters
use EmizorIpx\WhatsappCloudapi\Facades\WhatsappCloudapiMessage;
use EmizorIpx\WhatsappCloudapi\Messages\Template\Component;
use EmizorIpx\WhatsappCloudapi\Services\Whatsapp\Settings\WhatsappCloudApiSettings;
...
$cloud_settings = new WhatsappCloudApiSettings( $from_phone_number_id, $access_token );
$components = new Component($header_components, $body_components, $buttons_components);
WhatsappCloudapiMessage::sendMessageWithTemplate($cloud_settings, $phone_number, $template_name, $components);
- Parameters
from_phone_number_idPhone number identifier.access_tokenwhatsapp cloud api services access token.
统计信息
- 总下载量: 752
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-18