<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
astrotomic / notifynder-sender-messagebird example snippets
'senders' => [
'messagebird' => [
'access_key' => '',
'callbacks' => [
'sms' => function(\Astrotomic\Notifynder\Senders\Messages\SmsMessage $message, \Fenos\Notifynder\Models\Notification $notification) {
return $message
->from(...)
->to(...)
->body($notification->getText());
},
'voice' => function(\Astrotomic\Notifynder\Senders\Messages\CallMessage $message, \Fenos\Notifynder\Models\Notification $notification) {
return $message
->from(...)
->to(...)
->body($notification->getText())
->lang('en-gb')
->male();
},
],
'store' => false, // wether you want to also store the notifications in database
],
],
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Astrotomic\Notifynder\Senders\MessageBirdSmsSender;
use Astrotomic\Notifynder\Senders\Messages\SmsMessage;
use Astrotomic\Notifynder\Senders\MessageBirdCallSender;
use Astrotomic\Notifynder\Senders\Messages\CallMessage;
use Fenos\Notifynder\Builder\Notification;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
app('notifynder.sender')->setCallback(MessageBirdSmsSender::class, function (SmsMessage $message, Notification $notification) {
return $message
->from('0123456789')
->to('9876543210')
->text($notification->getText());
});
app('notifynder.sender')->setCallback(MessageBirdCallSender::class, function (CallMessage $message, Notification $notification) {
return $message
->from('0123456789')
->to('9876543210')
->lang('en-us')
->male()
->text($notification->getText());
});
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.