emizoripx / whatsapp-cloudapi
Library for sending Whatsapp messages with the Whatsapp Cloud Api service
Installs: 722
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/emizoripx/whatsapp-cloudapi
This package is auto-updated.
Last update: 2025-11-15 04:31:31 UTC
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.