angstrom / pandora-sms
A PHP client for sending SMS via Pandora SMS API
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/angstrom/pandora-sms
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-12-06 17:17:58 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