PHP code example of louisk / zenvia

1. Go to this page and download the library: Download louisk/zenvia library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

louisk / zenvia example snippets


  \Zenvia::sendMessage('5541999999999', 'Mensagem Teste');

  \Zenvia::sendMessage(['5541999999999', '5541999999999'], 'Mensagem Teste');

try {
    $zenvia = new Zenvia(config('zenvia.account'), config('zenvia.password'));

    $zenvia->setNumber('5541999999999')
        ->setNumber(['5541999999999', '5541999999999'])
        ->setNumber(collect(['5541999999999', '5541999999999']))
        ->setText('Mensagem Teste')
        ->send();
} catch (AuthenticationNotFoundedException $e) {
    // Some code
} catch (FieldMissingException $e) {
    // Some code
} catch (RequestException $e) {
    // Some code
}

php artisan zenvia:sms 5541999999999 teste