PHP code example of symfony / prelude-notifier
1. Go to this page and download the library: Download symfony/prelude-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 / prelude-notifier example snippets
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\Prelude\PreludeOptions;
$options = (new PreludeOptions())
->templateId('template_01k8xxxxxxxxxxxxx') // Required
->variables([
'order_id' => '12345',
'amount' => '$49.99',
])
// Optional parameters
// ->from('MySenderID')
// ->locale('fr-FR')
// ->callbackUrl('https://example.com/webhook')
// ->preferredChannel('whatsapp')
;
$message = (new SmsMessage('+33612345678', 'Subject (ignored)'))
->options($options);
$notifier->send($message);