jadessoriano / mobivate-sdk-php
Mobivate SDK for PHP
Fund package maintenance!
jadessoriano
Requires
- php: ^8.2
- ext-json: *
Requires (Dev)
- laravel/pint: ^1.5
- mockery/mockery: ^1.4
- pestphp/pest: ^3.7.4
- phly/keep-a-changelog: ^2.11
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0.1
- phpstan/phpstan-phpunit: ^2.0.4
- rector/rector: ^2.0.9
- spatie/ray: ^1.28
- ticketswap/phpstan-error-formatter: ^1.1
This package is auto-updated.
Last update: 2025-04-20 02:19:17 UTC
README
Mobivate Bulk SMS SDK for PHP
Mobivate Bulk SMS SDK for PHP:
TODO List:
- Search Message Logs
- Search for Single Message Log
Additional:
Installation
You can install the package via composer:
composer require jadessoriano/mobivate-sdk-php
Single Send SMS Message
use Jadessoriano\Mobivate\Client\Credentials\Basic; use Jadessoriano\Mobivate\Client\Sms\SendSingle; use Jadessoriano\Mobivate\MobivateClient; use Jadessoriano\Mobivate\Requests\Sms\Message; $client = new MobivateClient( new Basic('api_live_abcd1234efgh5678ijkl9012mnop3456') ); $response = (new SendSingle($client)) ->execute( new Message( originator: 'Test', // Optional: defaults to config value if not provided recipient: '44700011122', body: 'This is a test message', reference: 'sample', // Optional: defaults to null if not provided campaignId: '1-xxx' // Optional: defaults to null if not provided ) )
Send Batch SMS Messages
use Jadessoriano\Mobivate\Client\Credentials\Basic; use Jadessoriano\Mobivate\Client\Sms\SendBatch; use Jadessoriano\Mobivate\MobivateClient; use Jadessoriano\Mobivate\Requests\Sms\Batch\BatchMessage; use Jadessoriano\Mobivate\Requests\Sms\Batch\BatchMessageItem; $client = new MobivateClient( new Basic('api_live_abcd1234efgh5678ijkl9012mnop3456') ); /** * Note: The schedule date time (for later delivery) is optional, defaults to null if not provided. */ $message = (new BatchMessage()) ->setMessages([ new BatchMessageItem( originator: 'Test', // Optional: defaults to config value if not provided recipient: '44700011122', text: 'This is a test message' ) ]) ->setScheduleDateTime( new DateTime('+5 minutes', new DateTimeZone('Asia/Manila')) ) $response = (new SendBatch($client))->execute($message)
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.