PHP code example of tylercd100 / monolog-sms

1. Go to this page and download the library: Download tylercd100/monolog-sms 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/ */

    

tylercd100 / monolog-sms example snippets


use Tylercd100\Monolog\Handler\PlivoHandler;

$handler = new PlivoHandler($token,$auth_id,$fromPhoneNumber,$toPhoneNumber);
$logger  = new Monolog\Logger('channel.name');
$logger->pushHandler($handler);
$logger->addCritical("Foo Bar!");

use Tylercd100\Monolog\Handler\TwilioHandler;

$handler = new TwilioHandler($secret,$sid,$fromPhoneNumber,$toPhoneNumber);
$logger  = new Monolog\Logger('channel.name');
$logger->pushHandler($handler);
$logger->addCritical("Foo Bar!");

use Tylercd100\Monolog\Handler\ClickatellHandler;

$handler = new ClickatellHandler($authToken,$fromPhoneNumber (/*Optional*/),$toPhoneNumber (/*String|Array*/));
$logger  = new Monolog\Logger('channel.name');
$logger->pushHandler($handler);
$logger->addCritical("Foo Bar!");