A simple PHP wrapper for Textbelt, a free SMS API provider
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests Return responses after sending and add getter Oct 26, 2016
.gitignore Added unit tests. Oct 4, 2016
LICENSE Initial commit Apr 30, 2015
README.md Updating readme Oct 26, 2016
composer.json Replacing curl with guzzle Oct 5, 2016
composer.lock Replacing curl with guzzle Oct 5, 2016

README.md

Courier

A simple PHP Wrapper for Textbelt, a free SMS Provider

Installation

Courier is a composer package. Install using:

composer require ctrlaltdylan/courier

Usage

Example:

$courier = new Courier\Courier;

$courier->setRecipient('867530999')->setBody('Hello World')->send();

You can also chain for multiple messages in one line.

$body = "One hot body";

$courier->setRecipient('1112223333')->setBody($body)->send()
    new()->setRecipient('4445556666')->setBody($body)->send()
;

Note: Be sure to use the new() function before starting another message.

Options

Options are passed into courier via the 2nd argument in the constructor.

Regions

Courier provides the Canadian and International support given by Textbelt in a few ways.

Like through the constructor:

    $canadianCourier = new Courier\Courier(['body' => 'I <3 Vancouver'], ['region' => 'canada']);

Or with the setRegion method:

   $courier->setRegion('intl');

Supported regions:

  • us (default)
  • canada
  • intl (short for 'international')