A simple abstract SMS wrapper with support for templates.
src/
tests/
vendor/
Via Composer
$ composer require mentalist/sms
// 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();
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email tooone777@gmail.com instead of using the issue tracker.
Special thanks to The League of Extraordinary Packages for the inspiration and excellent starting point.
The MIT License (MIT). Please see License File for more information.