Git Product home page Git Product logo

sms's Introduction

sms

Simple SMS Gateway Package for sending short text messages. Currently Bulksms, Clickatell, Gupshup, Infobip, Itexmo, Mocker, MVaayoo, Nexmo, SmsAchariya, Smsapi, SmsCountry, SmsLane, twilio and Any HTTP/s based Gateways are supported with Custom Gateway. Default Log gateway can be used for testing.

Installation

composer require tecdiary/sms

Usage

Prepare your $config for your sms gateways as below (refer to sampleConfig.php for your sms gateway requirements). Initialize class with config and start sending sms messages $sms->send($mobile, $message);.

use Tecdiary\Sms\Sms;

$config = [
    'gateway' => 'Log',
    'log' => [
        'path' => __DIR__ . '/logs/sms.log',
        'level' => 100
    ]
];

$sms = new Sms($config);

Send Single SMS:

$sms->send('+919090909090', 'This is sms body');

Send Multiple SMS:

$sms->send(['+60123456789', '+601111442122'], 'This is sms body');

Gateway Response:

$response = $sms->send(['+60123456789', '+601111442122'], 'This is sms body')->response();

Gateways

Currently these gateways are supported

  1. Bulksms
  2. Clickatell
  3. Gupshup
  4. Infobip
  5. Itexmo
  6. Mocker
  7. MVaayoo
  8. Nexmo
  9. SmsAchariya
  10. Smsapi
  11. SmsCountry
  12. SmsLane
  13. Twilio
  14. Custom

Default Gateway: Log

Custom Gateway

Let us suppose you want to use any other gateway. Find the API URL with which SMS can be sent. For Example : http://example.com/api/sms.php?uid=737262316a&pin=YOURPIN&sender=your_sender_id&route=0&mobile=8888888888&message=How are You&pushid=1

Then you can setup the Config of Custom Gateway like this:

$config = [
  'gateway' => 'Custom',
  'Custom' => [
    'url' => 'http://example.com/api/sms.php?',
    'params' => [
      'send_to_name' => 'mobile',
      'msg_name' => 'message',
      'others' => [
        'uid' => '737262316a',
        'pin' => 'YOURPIN',
        'sender' => 'your_sender_id',
        'route' => '0',
        'pushid' => '1',
      ]
    ]
  ]
];

Contributing

Any sort of contributions and/or feedback is much appreciated, specially if you have added any new gateway. Just leave an issue or pull-request!

sms's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sms's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.