Send SMS from Laravel with the SendiMessage API
Laravel uses the official PHP SDK: composer require sendimessage/sdk. Bind the client in a service provider with credentials from config/services.php, and every job or listener can inject it.
Dispatch sends from queued jobs rather than inside web requests — the API responds with a queued message either way, and a job keeps checkout and booking flows fast. Incoming webhooks land on a normal Laravel route where you can verify the signature and update your models.
What this integration enables
Architecture
- Your application eventAn order ships, a booking nears, a ticket updates
- Laravel server codeBuilds the request with credentials from the environment
- SendiMessage APIPOST /send-message returns the queued message
- Managed messaging lineSMS, or iMessage on supported lines and destinations
- Webhook eventsDelivery status and incoming replies post back to your endpoint
Example request
<?php// composer require sendimessage/sdk// config/services.php:// 'sendimessage' => ['key' => env('SENDIMESSAGE_KEY'), 'secret' => env('SENDIMESSAGE_SECRET')]use SendImessage\ApiException;use SendImessage\Client;// app/Providers/AppServiceProvider.php$this->app->singleton(Client::class, fn () => new Client(apiKey: config('services.sendimessage.key'),apiSecret: config('services.sendimessage.secret'),));// app/Jobs/SendOrderShippedMessage.php — handle()public function handle(Client $client): void{try {$msg = $client->sendMessage(number: $this->order->customer->phone,content: "Hi {$this->order->customer->first_name}, your order has shipped.",);$this->order->update(['message_handle' => $msg['message_handle']]);} catch (ApiException $e) {report($e); // non-2xx → ApiException with status + body$this->release(60);}}
Delivery events and incoming replies
Point a Laravel route at your webhook URL to receive delivery status and incoming replies. Verify the signature header before processing.
// "outbound" event → your laravel endpoint// Verify the SendiMessage-Signature header (t={timestamp},v1=HMAC-SHA256 of// "{timestamp}.{raw body}", keyed with your webhook secret), then use// GET /v2/messages/{message_handle} for authoritative state and match it to// your contact_id in laravel.
Limitations and honest notes
- iMessage delivery is available on supported messaging lines and destinations. Recipients without iMessage receive SMS when fallback is configured — never assume universal iMessage availability.
- Messages are accepted asynchronously — the API returns status QUEUED and final status arrives via webhook or the message endpoints.
- Official SDKs are published for JavaScript/TypeScript (npm: sendimessage), Python (PyPI: sendimessage), PHP (Composer: sendimessage/sdk), and Go (github.com/sendimessage/sendimessage-go). Every SDK is dependency-free and covers the full public API surface.
Security considerations
- Keep the API key pair in server configuration or environment variables, never in the repository.
- Verify webhook signatures before trusting delivery or reply events.
Frequently asked questions
Is there an official Laravel package for SendiMessage?
Can Laravel receive message replies?
Should I send inside the request or from a queued job?
Related integrations
Ready to connect Laravel?
Request a messaging line and a SendiMessage integration specialist will review your Laravel workflow and guide the setup.