src/JetSmsService.php
public function sendShortMessages($messages)
    {
        if (! $messages instanceof ShortMessageCollection) {
            $collection = $this->collectionFactory->create();

            foreach ($messages as $message) {
                $collection->push($this->factory->create(
                    $message['recipient'],
                    $message['message']
                ));
            }

            $messages = $collection;
        }

        if (is_callable($this->beforeMultipleShortMessageCallback)) {
            call_user_func_array($this->beforeMultipleShortMessageCallback, [$messages]);
        }

        $response = $this->client->sendShortMessages($messages);

        if (is_callable($this->afterMultipleShortMessageCallback)) {
            call_user_func_array($this->afterMultipleShortMessageCallback, [$response, $messages]);
        }

        return $response;
    }
public function sendShortMessages($messages)
    {
        if (! $messages instanceof ShortMessageCollection) {
            $collection = $this->collectionFactory->create();

            foreach ($messages as $message) {
                $collection->push($this->factory->create(
                    $message['recipient'],
                    $message['message']
                ));
            }

            $messages = $collection;
        }

        if (is_callable($this->beforeMultipleShortMessageCallback)) {
            call_user_func_array($this->beforeMultipleShortMessageCallback, [$messages]);
        }

        $response = $this->client->sendShortMessages($messages);

        if (is_callable($this->afterMultipleShortMessageCallback)) {
            call_user_func_array($this->afterMultipleShortMessageCallback, [$response, $messages]);
        }

        return $response;
    }
public function sendShortMessages ( $ messages ) { if ( ! $ messages instanceof ShortMessageCollection ) { $ collection = $ this -> collectionFactory -> create ( ) ; foreach ( $ messages as $ message ) { $ collection -> push ( $ this -> factory -> create ( $ message [ 'recipient' ] , $ message [ 'message' ] ) ) ; } $ messages = $ collection ; } if ( is_callable ( $ this -> beforeMultipleShortMessageCallback ) ) { call_user_func_array ( $ this -> beforeMultipleShortMessageCallback , [ $ messages ] ) ; } $ response = $ this -> client -> sendShortMessages ( $ messages ) ; if ( is_callable ( $ this -> afterMultipleShortMessageCallback ) ) { call_user_func_array ( $ this -> afterMultipleShortMessageCallback , [ $ response , $ messages ] ) ; } return $ response ; }
Send the given short messages.

@param  array|ShortMessageCollection $messages An array containing short message arrays or collection.

@return JetSmsResponseInterface The parsed JetSms response object.
Send the given short messages .