PHP code example of drewlabs / envoyer-twilio

1. Go to this page and download the library: Download drewlabs/envoyer-twilio 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/ */

    

drewlabs / envoyer-twilio example snippets


use Drewlabs\Envoyer\Contracts\NotificationResult;
use Drewlabs\Envoyer\Drivers\Twilio\TwilioAdapter;
use Drewlabs\Envoyer\Message;

// Create an adapter instance
$adapter = TwilioAdapter::new('key', 'secret');

// Create message instance
$message = Message::new()->from('22990667812')->to('22890667723')->content('Hi!');

// Send message using the adapter
$result = $adapter->sendRequest($message); // NotificationResult