fredriktid/key-sms-sdk

v0.1.4 2018-05-30 09:21 UTC

This package is not auto-updated.

Last update: 2024-05-11 18:07:26 UTC


README

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();