mentalist / sms
A simple abstract SMS wrapper with support for templates
dev-master / 1.0.x-dev
2018-02-07 09:16 UTC
Requires
- php: ~5.6
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- mentalist/logme: @dev
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2025-05-05 10:49:27 UTC
README
A simple abstract SMS wrapper with support for templates.
Structure
src/
tests/
vendor/
Install
Via Composer
$ composer require mentalist/sms
Usage
// Create a recipient $recipient = '555-555-5555'; // Use default Provider $SMS = new \Mentalist\SMS\SMS(); // Add a recipient $SMS->addRecipient($recipient); // Set the message $SMS->setMessage('Hello, League!'); // Send it! $SMS->send(); // Use Nexmo Provider $provider = new \Mentalist\SMS\Provider\NexmoProvider('NEXMO_API_KEY', 'NEXMO_API_SECRET'); $SMS = new \Mentalist\SMS\SMS($provider); // Add multiple recipients $SMS->addRecipients([$recipient, '555-000-5555']); // Set the message $SMS->setMessage('Sent using Nexmo!'); // Send it! $SMS->send(); // Clear recipients $recipients = $SMS->clearRecipients(); // Get credits $credits = $SMS->getCredits(); // or $credits = $provider->getCredits();
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email tooone777@gmail.com instead of using the issue tracker.
Credits
Special thanks to The League of Extraordinary Packages for the inspiration and excellent starting point.
License
The MIT License (MIT). Please see License File for more information.