examples/whatsapp.php
private function sendBroadcast()
    {
        if (isset($this->inputs['action']) && trim($this->inputs['action']) == 'sendBroadcast') {
            $this->connectToWhatsApp();
            if (isset($this->inputs['message']) && trim($this->inputs['message'] !== '')) {
                $this->wa->sendBroadcastMessage($this->inputs['to'], $this->inputs['message']);
            }
            if (isset($this->inputs['image']) && $this->inputs['image'] !== false) {
                $this->wa->sendBroadcastImage($this->inputs['to'], $this->inputs['image']);
            }
            if (isset($this->inputs['audio']) && $this->inputs['audio'] !== false) {
                $this->wa->sendBroadcastAudio($this->inputs['to'], $this->inputs['audio']);
            }
            if (isset($this->inputs['video']) && $this->inputs['video'] !== false) {
                $this->wa->sendBroadcastVideo($this->inputs['to'], $this->inputs['video']);
            }
            if (isset($this->inputs['locationname']) && trim($this->inputs['locationname'] !== '')) {
                $this->wa->sendBroadcastPlace($this->inputs['to'], $this->inputs['userlong'], $this->inputs['userlat'], $this->inputs['locationname'], null);
            }
            exit(json_encode([
                'success'  => true,
                'data'     => 'Broadcast Message Sent!',
                'messages' => $this->messages,
            ]));
        }
    }
private function sendBroadcast()
    {
        if (isset($this->inputs['action']) && trim($this->inputs['action']) == 'sendBroadcast') {
            $this->connectToWhatsApp();
            if (isset($this->inputs['message']) && trim($this->inputs['message'] !== '')) {
                $this->wa->sendBroadcastMessage($this->inputs['to'], $this->inputs['message']);
            }
            if (isset($this->inputs['image']) && $this->inputs['image'] !== false) {
                $this->wa->sendBroadcastImage($this->inputs['to'], $this->inputs['image']);
            }
            if (isset($this->inputs['audio']) && $this->inputs['audio'] !== false) {
                $this->wa->sendBroadcastAudio($this->inputs['to'], $this->inputs['audio']);
            }
            if (isset($this->inputs['video']) && $this->inputs['video'] !== false) {
                $this->wa->sendBroadcastVideo($this->inputs['to'], $this->inputs['video']);
            }
            if (isset($this->inputs['locationname']) && trim($this->inputs['locationname'] !== '')) {
                $this->wa->sendBroadcastPlace($this->inputs['to'], $this->inputs['userlong'], $this->inputs['userlat'], $this->inputs['locationname'], null);
            }
            exit(json_encode([
                'success'  => true,
                'data'     => 'Broadcast Message Sent!',
                'messages' => $this->messages,
            ]));
        }
    }
private function sendBroadcast ( ) { if ( isset ( $ this -> inputs [ 'action' ] ) && trim ( $ this -> inputs [ 'action' ] ) == 'sendBroadcast' ) { $ this -> connectToWhatsApp ( ) ; if ( isset ( $ this -> inputs [ 'message' ] ) && trim ( $ this -> inputs [ 'message' ] !== '' ) ) { $ this -> wa -> sendBroadcastMessage ( $ this -> inputs [ 'to' ] , $ this -> inputs [ 'message' ] ) ; } if ( isset ( $ this -> inputs [ 'image' ] ) && $ this -> inputs [ 'image' ] !== false ) { $ this -> wa -> sendBroadcastImage ( $ this -> inputs [ 'to' ] , $ this -> inputs [ 'image' ] ) ; } if ( isset ( $ this -> inputs [ 'audio' ] ) && $ this -> inputs [ 'audio' ] !== false ) { $ this -> wa -> sendBroadcastAudio ( $ this -> inputs [ 'to' ] , $ this -> inputs [ 'audio' ] ) ; } if ( isset ( $ this -> inputs [ 'video' ] ) && $ this -> inputs [ 'video' ] !== false ) { $ this -> wa -> sendBroadcastVideo ( $ this -> inputs [ 'to' ] , $ this -> inputs [ 'video' ] ) ; } if ( isset ( $ this -> inputs [ 'locationname' ] ) && trim ( $ this -> inputs [ 'locationname' ] !== '' ) ) { $ this -> wa -> sendBroadcastPlace ( $ this -> inputs [ 'to' ] , $ this -> inputs [ 'userlong' ] , $ this -> inputs [ 'userlat' ] , $ this -> inputs [ 'locationname' ] , null ) ; } exit ( json_encode ( [ 'success' => true , 'data' => 'Broadcast Message Sent!' , 'messages' => $ this -> messages , ] ) ) ; } }
Sends a broadcast Message to a group of contacts.

Currenly only sends a normal message to
a group of contacts.

@return void
Sends a broadcast Message to a group of contacts .