2017 © Pedro Peláez
 

library esemeser

PHP Library for sending SMS through esemeser.pl API

image

devstrefa/esemeser

PHP Library for sending SMS through esemeser.pl API

  • Monday, September 5, 2016
  • by Cichy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Esemeser 1.1.0

PHP Library designed to sending SMS messages through esemeser.pl API, (*1)

Before you use it!

Esemeser.pl is a Polish service for sending SMS messages, so remember that You can send messages only to Polish phone numbers those numbers must be in format: xxxxxxxxx (9 digits), other numbers probably will not work., (*2)

This library is using file_get_contents as default mechanism to send requests, so before You start using it, make sure you have properly configured environment. Check if your allow_url_fopen is set to "1". You can use CURL instead of file_get_contents please read below to get more information., (*3)

How to install

Library is compatible with composer so You can install it by adding:, (*4)

"require": {
        "devstrefa/esemeser": "1.0.x-dev"
    }

to Your composer.json file, (*5)

You can also download zip file and include all necessary files by yourself, (*6)

How to use

Library is designed for 2 main tasks:, (*7)

1. Sending Messages, (*8)

Below you can see example of code sending some message:, (*9)

<?php

use DevStrefa\Esemeser\Esemeser;
use DevStrefa\Esemeser\Message;
use DevStrefa\Esemeser\MessageType;

require_once ('../vendor/autoload.php');

try {

    $esemeser = new Esemeser();    
    $esemeser->setLogin('login')->setAccount('account_name')->setPassword('password');

    $message = new Message();
    $message->setClientName('client_name')->setPhoneNumber('123456789')->setMessage('test')->setMessageType(MessageType::ECO);
    $esemeser->send($message);

} catch (\Exception $e){
    var_dump($e);
}

2. Checking Balance, (*10)

Second function of library is checking how many messages of given type You can still send with Your current balance. To do this use library like in code below:, (*11)

<?php

use DevStrefa\Esemeser\Esemeser;
use DevStrefa\Esemeser\MessageType;

require_once ('../vendor/autoload.php');

try {

    $esemeser = new Esemeser();
    $esemeser->setLogin('login')->setAccount('account_name')->setPassword('password');

    $balance=$esemeser->checkBalance(MessageType::ECO);

    echo $balance;


} catch (\Exception $e){
    var_dump($e);
}

How to use CURL instead of file_get_contents

Since version 1.1.0 of library, You can choose mechanism which is used to make requests to API, if you want to do this add this line to Your code:, (*12)

$esemeser->setRequestMethod('fgc');

available values for setRequestMethod are: * fgc - for file_get_contents * curl - for curl library, (*13)

For more information about library please read generated documentation., (*14)

Changelog

You can see Changelog for this project here, (*15)

License

Whole code in this repository is Under MIT license, (*16)

The Versions

05/09 2016

dev-master

9999999-dev https://github.com/DevStrefa/esemeser

PHP Library for sending SMS through esemeser.pl API

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Avatar Cichy

sms esemeser esemeser.pl

05/09 2016

dev-develop

dev-develop https://github.com/DevStrefa/esemeser

PHP Library for sending SMS through esemeser.pl API

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Avatar Cichy

sms esemeser esemeser.pl

05/09 2016

1.1.0

1.1.0.0 https://github.com/DevStrefa/esemeser

PHP Library for sending SMS through esemeser.pl API

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Avatar Cichy

sms esemeser esemeser.pl

15/08 2016

1.0.0

1.0.0.0 https://github.com/DevStrefa/esemeser

PHP Library for sending SMS through esemeser.pl API

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Avatar Cichy

sms esemeser esemeser.pl