- Can I use symfony/clickatell-notifier directly in Laravel without Symfony components?
- No, this package is a Symfony Notifier bridge and requires a custom Laravel adapter layer. You’ll need to wrap Symfony’s TransportInterface in a Laravel service provider or facade. For minimal setup, use GuzzleHTTP directly with Clickatell’s API instead.
- How do I configure Clickatell Notifier in Laravel’s .env file?
- Use the DSN format: `CLICKATELL_DSN=clickatell://ACCESS_TOKEN@default?from=Sender`. Store your Clickatell API token and sender ID (e.g., `FROM=YourApp`) in your `.env` file. Ensure the DSN is loaded via Laravel’s config binding.
- Does this package support async SMS delivery with Laravel Queues?
- Yes, but you’ll need to implement a Laravel Queue job wrapping the Symfony transport. Use `retry_after` delays to replicate Symfony Messenger’s retry logic. Example: Dispatch a `SendClickatellSms` job with exponential backoff for failed attempts.
- What Laravel versions are officially supported by this package?
- The package itself doesn’t enforce Laravel version constraints, but it requires PHP 8.1+ and Symfony 6.3+. Test compatibility with Laravel 10/11 by ensuring your adapter layer aligns with Laravel’s service container and GuzzleHTTP (v7+) dependencies.
- How do I handle errors or failed SMS deliveries in production?
- Leverage Laravel’s exception handler to log failures via Monolog or Sentry. For retries, use Laravel Queues with `retry_after` or implement a custom retry decorator around the Symfony transport. Monitor failed jobs in Laravel’s queue worker logs.
- Is there a way to send bulk SMS or multi-recipient messages?
- Yes, the Clickatell API supports multi-recipient messages. Pass an array of phone numbers to the Symfony `Message` object’s `to()` method. Example: `$message->to(['+1234567890', '+0987654321'])` before sending via the transport.
- Can I use this package alongside other SMS providers like Twilio or Nexmo?
- Technically yes, but avoid conflicts by isolating configurations (e.g., separate `.env` keys for each provider). If using Laravel Notifier, consider a unified facade to switch between transports dynamically. Test thoroughly for API key or config overlaps.
- What’s the best way to test Clickatell Notifier in a Laravel app?
- Use Clickatell’s sandbox environment (if available) or mock the Symfony transport with a test double. In Laravel, override the bound service in `phpunit.xml` or use a fake transport in tests. Verify DSN parsing and error handling with invalid tokens or phone numbers.
- Does this package support templated or scheduled SMS messages?
- No, this package only handles basic SMS delivery via Clickatell’s REST API. For templated messages, use Clickatell’s API directly or extend the Symfony transport with custom logic. Scheduled messages require Laravel’s scheduler to dispatch jobs at specific times.
- Are there alternatives to symfony/clickatell-notifier for Laravel?
- Yes, consider dedicated Laravel packages like `spatie/laravel-sms` or `laravel-notification-channels/clickatell`. These are natively Laravel-compatible and may offer better integration with Laravel’s notification system. Evaluate based on your need for Symfony dependencies.