public function send($testmode = false)
    {
        if (empty($this->messages)) {
            return false;
        }

        $data = array_replace($this->params, [
            'username'   => $this->username,
            'password'   => $this->password,
            'batch_data' => $this->generateCSV(),
        ]);

        // add test params if required
        if ($testmode) {
            if ($testmode == BulkSmsService::TEST_ALWAYS_SUCCEED) {
                $data['test_always_succeed'] = 1;
            } elseif ($testmode == BulkSmsService::TEST_ALWAYS_FAIL) {
                $data['test_always_fail'] = 1;
            }
        }

        return $this->curl->post($this->getUrl(), $data);
    }
public function send($testmode = false)
    {
        if (empty($this->messages)) {
            return false;
        }

        $data = array_replace($this->params, [
            'username'   => $this->username,
            'password'   => $this->password,
            'batch_data' => $this->generateCSV(),
        ]);

        // add test params if required
        if ($testmode) {
            if ($testmode == BulkSmsService::TEST_ALWAYS_SUCCEED) {
                $data['test_always_succeed'] = 1;
            } elseif ($testmode == BulkSmsService::TEST_ALWAYS_FAIL) {
                $data['test_always_fail'] = 1;
            }
        }

        return $this->curl->post($this->getUrl(), $data);
    }
public function send ( $ testmode = false ) { if ( empty ( $ this -> messages ) ) { return false ; } $ data = array_replace ( $ this -> params , [ 'username' => $ this -> username , 'password' => $ this -> password , 'batch_data' => $ this -> generateCSV ( ) , ] ) ; // add test params if required if ( $ testmode ) { if ( $ testmode == BulkSmsService :: TEST_ALWAYS_SUCCEED ) { $ data [ 'test_always_succeed' ] = 1 ; } elseif ( $ testmode == BulkSmsService :: TEST_ALWAYS_FAIL ) { $ data [ 'test_always_fail' ] = 1 ; } } return $ this -> curl -> post ( $ this -> getUrl ( ) , $ data ) ; }
Send the queued messages.

@param bool $testmode Testmode to use

@return mixed
Send the queued messages .