Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bulkgate/sms

✉️ BulkGate SMS PHP SDK - The complete package for fast integration to PHP projects. Built-in support for Nette framework. Simplify your work. Integrate the SMS gateway quickly and easily into your PHP projects.
https://github.com/bulkgate/sms

bulkgate nette-framework php-sdk php7 sms sms-gateway

Last synced: about 8 hours ago
JSON representation

✉️ BulkGate SMS PHP SDK - The complete package for fast integration to PHP projects. Built-in support for Nette framework. Simplify your work. Integrate the SMS gateway quickly and easily into your PHP projects.

Awesome Lists containing this project

README

        

The SDK is outdated, please use it https://github.com/BulkGate/php-sdk
=============

BulkGate SMS - PHP SDK
=============

[![Downloads](https://img.shields.io/packagist/dt/bulkgate/sms.svg)](https://packagist.org/packages/bulkgate/sms)
[![Latest Stable Version](https://img.shields.io/github/release/bulkgate/sms.svg)](https://github.com/bulkgate/sms/releases)
[![License](https://img.shields.io/github/license/bulkgate/sms.svg)](https://github.com/BulkGate/sms/blob/master/LICENSE)

- [Documentation](https://help.bulkgate.com/docs/en/php-sdk-instalation.html)
- [BulkGate portal](https://portal.bulkgate.com/)
- [BulkGate](https://www.bulkgate.com)

## Instalation

The easiest way to install [bulkgate/sms](https://packagist.org/packages/bulkgate/sms) into a project is by using [Composer](https://getcomposer.org/) via the command line.

```
composer require bulkgate/sms
```

If you have the package installed just plug in the autoloader.

``` php
require_once __DIR__ . '/vendor/autoload.php';
```

In order to send messages, you need an instance of the `BulkGate\Sms\Sender` class that requires instance dependency on the `BulkGate\Message\Connection` class.

``` php
$connection = new BulkGate\Message\Connection('APPLICATION_ID', 'APPLICATION_TOKEN');

$sender = new BulkGate\Sms\Sender($connection);
```

At this point, you are ready to send a message.

``` php
$message = new BulkGate\Sms\Message('447971700001', 'test message');

$sender->send($message);
```

The `send()` method will send a message `$message`.

## Nette framework

Register the extension to the DI container via NEON

``` neon
extensions:
bulkgate: BulkGate\Message\Bridges\MessageDI\MessageExtension

bulkgate:
application_id:
application_token:
```

which gives you the class [`BulkGate\Sms\Sender`](php-sdk-sender.md) as a service you can request.

``` php
sender->send(new BulkGate\Sms\Message('447971700001', 'test message'));
}
}
```

### Tracy

At the same time, you'll get the extension for [Tracy](https://tracy.nette.org) panel

![bulkgate-sdk-tracy](https://github.com/BulkGate/help/raw/master/website/static/img/sdk-tracy.png)