PHP code example of gl-package / notification-manager
1. Go to this page and download the library: Download gl-package/notification-manager 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/ */
gl-package / notification-manager example snippets
use GlPackage\NotificationManager\Notifications\TelegramNotification;
$data = [
'message' => "<b>Hello World!</b> Click the button below:",
'buttons' => [
[
['text' => 'Click Me', 'url' => 'https://example.com'] // Optional , else pass [] array
]
]
];
$telegram = new TelegramNotification();
$telegram->quickSend($data); // For quick send
// or
$telegram->queueSend($data); // For queued send
use GlPackage\NotificationManager\Notifications\EmailNotification;
use Faker\Factory as Faker;
$data = [
'to_address' => Faker::create()->email,
'subject' => 'Welcome to Our Service',
'body' => 'Thank you for signing up! Here are some details about your account.',
'view' => 'notificationmanager.testmail', // Optional view page location
'attachments' => [], // Optional attachments array
'name' => 'Hello, Ajay' // Optional parameters
];
$mail = new EmailNotification();
$mail->send($data); // Send mail via queue
// Ensure to run: php artisan queue:work or use Supervisor