Skip to content

fredriktid/key-sms-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP SDK for KeySMS

Latest Version Software License Build Status Scrutinizer Code Quality Total Downloads

A simple PHP SDK for KeySMS.

Requirements

This SDK has a dependency on the virtual package php-http/client-implementation which requires to you install a compatible adapter. Any such adapter will be automatically detected. You might for instance want to use Guzzle.

composer require php-http/guzzle6-adapter

Install

composer require fredriktid/key-sms-sdk

Usage

<?php

use \FTidemann\KeySms;

$auth = new KeySms\Auth('username', 'apiKey');

$message = new KeySms\Sms\Message();
$message->setContent(new KeySms\Sms\Content('Your message'));
$message->addRecipient(new KeySms\Sms\Recipient(55555555));
$message->addRecipient(new KeySms\Sms\Recipient(66666666));

$client= new KeySms\Client($auth);
$client->setMessage($message);
$client->setHttpClient(new \Http\Adapter\Guzzle6\Client()); // optional
$client->sendSms();