Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ctrlaltdylan/courier
A simple PHP wrapper for Textbelt, a free SMS API provider
https://github.com/ctrlaltdylan/courier
Last synced: about 2 months ago
JSON representation
A simple PHP wrapper for Textbelt, a free SMS API provider
- Host: GitHub
- URL: https://github.com/ctrlaltdylan/courier
- Owner: ctrlaltdylan
- License: gpl-2.0
- Created: 2015-04-30T19:47:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-26T17:31:20.000Z (almost 8 years ago)
- Last Synced: 2024-07-19T03:05:12.008Z (2 months ago)
- Language: PHP
- Size: 26.4 KB
- Stars: 21
- Watchers: 8
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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')