PHP code example of symfony / smsbox-notifier

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


use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Charset;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Day;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Encoding;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Mode;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Strategy;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Udh;
use Symfony\Component\Notifier\Bridge\Smsbox\SmsboxOptions;
use Symfony\Component\Notifier\Message\SmsMessage;

$sms = new SmsMessage('+33123456789', 'Your %1% message %2%');
$options = (new SmsboxOptions())
    ->mode(Mode::Expert)
    ->strategy(Strategy::NotMarketingGroup)
    ->sender('Your sender')
    ->date('DD/MM/YYYY')
    ->hour('HH:MM')
    ->coding(Encoding::Unicode)
    ->charset(Charset::Iso1)
    ->udh(Udh::DisabledConcat)
    ->callback(true)
    ->allowVocal(true)
    ->maxParts(2)
    ->validity(100)
    ->daysMinMax(min: Day::Tuesday, max: Day::Friday)
    ->hoursMinMax(min: 8, max: 10)
    ->variable(['variable1', 'variable2'])
    ->dateTime(new \DateTime())
    ->destIso('FR');

$sms->options($options);
$texter->send($sms);