symfony/infobip-notifier
Symfony Notifier integration for Infobip. Send SMS/notifications via Infobip by configuring the INFOBIP_DSN (auth token, host, and sender/from). Part of the Symfony Notifier ecosystem.
Pros:
infobip://AUTH_TOKEN@HOST?from=FROM format aligns with Laravel’s .env and configuration-driven patterns, reducing setup complexity.Cons:
symfony/notifier) and related components (e.g., symfony/http-client), which may introduce indirect dependencies if not already present in the Laravel stack.Symfony-Laravel Bridge:
symfony/notifier as a service in Laravel’s container, aliased to a Laravel-specific facade or service class..env and inject the DSN into the transport factory:
// config/services.php
$container->singleton(\Symfony\Component\Notifier\Notifier::class, function ($container) {
return new \Symfony\Component\Notifier\Notifier([
new \Symfony\Component\Notifier\Bridge\Infobip\InfobipTransportFactory(env('INFOBIP_DSN')),
]);
});
MessageSentEvent/TransportFailedEvent to Laravel’s event system using Symfony\Component\EventDispatcher\EventDispatcher.Laravel-Specific Challenges:
SendNotificationJob) to avoid blocking HTTP requests and leverage Laravel’s queue system.public function register()
{
$this->app->singleton('infobip.notifier', function ($app) {
return new \Symfony\Component\Notifier\Notifier([
new \Symfony\Component\Notifier\Bridge\Infobip\InfobipTransportFactory(env('INFOBIP_DSN')),
]);
});
}
Dependency Conflicts:
symfony/http-client or other Symfony components if Laravel’s ecosystem enforces stricter version constraints.composer.json and resolve conflicts using composer why-not or platform-check.Infobip API Changes:
class RetryableInfobipTransport implements TransportInterface
{
private $transport;
private $retryStrategy;
public function __construct(TransportInterface $transport, RetryStrategy $retryStrategy)
{
$this->transport = $transport;
$this->retryStrategy = $retryStrategy;
}
public function send(MessageInterface $message): void
{
$this->retryStrategy->execute(function () use ($message) {
$this->transport->send($message);
});
}
}
Testing Gaps:
NotificationSent events).Business Justification:
Multi-Channel Strategy:
laravel-notification-channels/infobip)? If so, what is the migration path?Operational Ownership:
Performance and Scaling:
Compliance and Security:
Monitoring and Observability:
symfony/psr-http-message-bridge, symfony/http-client).symfony/mailer or symfony/notifier, integration is straightforward. Otherwise, add it as a dependency.MessageSentEvent/TransportFailedEvent for extensibility.Assessment Phase:
Dependency Setup:
composer.json:
composer require symfony/notifier symfony/http-client symfony/options-resolver
.env with Infobip DSN:
INFOBIP_DSN=infobip://AUTH_TOKEN@api.infobip.com?from=YourSender
Core Integration:
// app/Providers/InfobipNotifierServiceProvider.php
public function register()
{
$this->app->singleton('infobip.notifier', function ($app) {
return new \Symfony\Component\Notifier\Notifier([
new \Symfony\Component\Notifier\Bridge\Infobip\InfobipTransportFactory(env('INFOBIP_DSN')),
]);
});
}
config/app.php.Laravel-Specific Adaptations:
// app/Jobs/SendNotificationJob.php
public function handle()
{
$notifier = app('infobip.notifier');
$notifier->send(new SMSMessage('Hello!', $this->recipient));
}
// app/Listeners/InfobipEventListener.php
public function handle(MessageSentEvent $event)
{
event(new NotificationSent($event->getMessage()));
}
Testing and Validation:
How can I help you explore Laravel packages today?