PHP code example of symfony / sweego-notifier

1. Go to this page and download the library: Download symfony/sweego-notifier 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/ */

    

symfony / sweego-notifier example snippets


use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\Sweego\SweegoOptions;

$sms = new SmsMessage('+1411111111', 'My message');

$options = (new SweegoOptions())
    // False by default, set 'bat' to true enable test mode (no sms sent, only for testing purpose)
    ->bat(true)
    // Optional, used for tracking / filtering purpose on our platform; identity an SMS campaign and allow to see logs / stats only for this campaign
    ->campaignId('string')
    // True by default, we replace all url in the SMS content by a shortened url version (reduce the characters of the sms)
    ->shortenUrls(true)
    // True by default, add scheme to shortened url version
    ->shortenWithProtocol(true);

// Add the custom options to the sms message and send the message
$sms->options($options);

$texter->send($sms);