Skip to content

A PHP client for the Clickatell SMS gateway

License

Notifications You must be signed in to change notification settings

WildfireInternet/Clickatell

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clickatell PHP client

A simple library to send SMS through the Clickatell SMS gateway.

Clickatell supports two character encodings: 7-bit (up to 160 characters per message) and Unicode (up to 70 characters per message). The choice of the encoding directly influences the number of credits debited when sending an SMS.

This library automatically handles character set conversion, using 7-bit whenever possible and switching to Unicode only when required. This guarantees a perfect delivery of the original message, while minimizing credit consumption.

Basic usage

$client = new Clickatell\ClickatellClient('api-id', 'username', 'password');
$client->authenticate();
$client->send('441234567890', 'Hello world');

The authenticate() call is required once, whether you need to send() one or several SMS messages.

The phone numbers must be in E.164 international format: country code + national number without 0 prefix. They must not include a leading + sign.

The message must use the UTF-8 charset.

Sender ID

If you registered a sender ID with Clickatell, you can specify it when instantiating the library:

$client = new Clickatell\ClickatellClient('api-id', 'username', 'password', 'sender-id');

It will then automatically be used for every send() call. Alternatively, you can pass it to every call individually:

$client->send('441234567890', 'Hello world', 'sender-id');

About

A PHP client for the Clickatell SMS gateway

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%