symfony/allmysms-notifier
Symfony Notifier bridge for AllMySms. Configure via ALLMYSMS_DSN with login, API key, and optional sender. Send SmsMessage through AllMySms and customize delivery using AllMySmsOptions (campaign, scheduling, simulation, identifiers, verbosity).
.env pattern, reducing boilerplate.SmsSent, SmsFailed) for observability. Supports retry logic via Laravel’s queue backends (e.g., Redis, database).AllMySmsOptions can be extended with Laravel-specific logic (e.g., dynamic from numbers from a database) via decorator pattern or traits.via() array in Notifiable trait).// app/Services/SmsNotifier.php
class SmsNotifier {
public function send(SmsMessage $message): void {
$texter = new AllMySmsTransport($this->dsn);
$texter->send($message);
}
}
.env supports the ALLMYSMS_DSN format natively, with validation via Laravel’s config/caching.Bus::dispatch(new SendSmsJob($message));
AllMySmsTransport in unit tests; use Pest/Laravel’s HTTP testing for API contract tests.HttpClient). Mitigate by composer vendor-patching or custom transport layer.AllMySmsApiClient) for easy swapping.CircuitBreaker) and fallback mechanisms (e.g., email backup).Notifier with Laravel’s events, jobs, and queues for async SMS delivery.
// User requests SMS
event(new SmsRequested($user, $message));
// Listener dispatches job
SendSmsJob::dispatch($user->phone, $message);
// Job uses the bridge
$texter = new AllMySmsTransport(config('services.allmysms.dsn'));
$texter->send(new SmsMessage($user->phone, $message));
HttpClient via Laravel’s Http facade or Guzzle for API calls.SmsSent/SmsFailed events to integrate with Laravel Echo or third-party tools (e.g., Slack alerts).SmsNotifier) to abstract Symfony’s Notifier.SendSmsJob) with retry logic.SmsSent/SmsFailed.throttle middleware).HttpClient.laravel-notification-channels/allmysms)..env and validate credentials.SendSmsJob with queue support.SmsSent/SmsFailed to trigger actions (e.g., analytics).allmysms-notifier for breaking changes. Use Composer’s platform-check to enforce PHP 8.4+.?apiVersion=v9.0).Log::channel('sms')->info('SMS sent', ['message_id' => $response->getId()]);
LOGIN:APIKEY and from number.SendSmsJob.| Failure | Detection | Mitigation | Owner |
|---|---|---|---|
| AllMySMS API downtime | Job timeouts | Fallback to email; alert on-call team | DevOps |
| Rate limiting | HTTP 429 responses | Exponential backoff + queue thrott |
How can I help you explore Laravel packages today?