PHP code example of sol-parts / symfony-smsfly-notifier
1. Go to this page and download the library: Download sol-parts/symfony-smsfly-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/ */
sol-parts / symfony-smsfly-notifier example snippets
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\TexterInterface;
/** @var TexterInterface $texter */
$texter = /*...*/;
$sms = new SmsMessage('+380771234567', 'My sms message');
$texter->send($sms);
use SolParts\SymfonySmsFlyNotifier\SmsFlyOptions;
use Symfony\Component\Notifier\Message\SmsMessage;
$options = (new SmsFlyOptions())
// Message sending channels.
// Available values are viber, sms. If you specify multiple channels, the message is sent to the channels in order of priority.
// The message is sent to the next channel if delivery to the previous one was not successful.
// If not specified, ['sms'] will be used.
->channels(['viber', 'sms'])
->viber_source('Promo') // The Viber sender name, if not specified, will be the same as for SMS.
->viber_text('🎁 A special gift from Example Corp is here') // Optional field, Viber message text up to 1000 characters long. If not specified, the SMS message text will be used.
->viber_button_caption('Go to site') // Optional field
->viber_button_url('https://example.com/') // Optional field
->viber_image('https://example.com/image.jpg') // Optional field
->ttl(1440)
;
/** @var SmsMessage $sms */
$sms = /*...*/;
$sms->options($options);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.