A simple abstract SMS wrapper with support for templates

dev-master / 1.0.x-dev 2018-02-07 09:16 UTC

This package is not auto-updated.

Last update: 2024-04-22 05:33:18 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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.