angstrom / pandora-sms
A PHP client for sending SMS via Pandora SMS API
v1.3.0
2025-02-06 15:03 UTC
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-07-06 16:21:18 UTC
README
A PHP client for sending SMS via Pandora SMS API.
Installation
composer require angstrom/pandora-sms
Configuration
Create a .env
file in your project root with your Pandora SMS credentials:
PANDORA_SMS_USERNAME=your_username PANDORA_SMS_PASSWORD=your_password PANDORA_SMS_BASE_URL=https://www.sms.thepandoranetworks.com/API/send_sms/
Usage
use Angstrom\PandoraSmsClient; // Initialize the client (it will use credentials from .env) $client = new PandoraSmsClient(); // Send SMS $result = $client->sendSms( '0712345678', // Phone number 'Hello, World!', // Message 'YourSenderID', // Sender ID (must be approved) 'non_customised', // Message type (non_customised or customised) 'bulk' // Message category (bulk) ); // Handle the response if ($result['success']) { echo "Message sent successfully!\n"; echo "Balance: " . $result['data']['balance'] . "\n"; echo "SMS Cost: " . $result['data']['sms_cost'] . "\n"; } else { echo "Error: " . ($result['messages'][0] ?? $result['error_message']) . "\n"; }
Response Format
Successful response:
{ "statusCode": 201, "success": true, "messages": [ "Message sent to 1 contacts. 0 were found to be unsupported. 0 contacts were duplicate and were merged." ], "data": { "supported_contacts": 1, "unsupported_contacts": 0, "sms_cost": 25, "balance": 9430 } }
Parameters
number
: Phone number in local format (e.g., '0712345678')message
: The SMS text contentsender
: Your approved sender IDmessageType
: Either 'non_customised' or 'customised'messageCategory
: Use 'bulk' for sending messages