2017 © Pedro Peláez
 

library sms-module

ZF3 module for SMS communication

image

massimo-filippi/sms-module

ZF3 module for SMS communication

  • Friday, October 27, 2017
  • by bedi
  • Repository
  • 4 Watchers
  • 2 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

sms-module

ZF3 module for SMS communication, (*1)

Packagist License, (*2)

Introduction

There will be more info soon..., (*3)

Installation

1. Install via Composer

Install the latest stable version via Composer:, (*4)

composer require massimo-filippi/sms-module

Install the latest develop version via Composer:, (*5)

composer require massimo-filippi/sms-module:dev-master

2. Enable module in your application

Composer should enable MassimoFilippi\SmsModule in your project automatically during installation., (*6)

In case it does not, you can enable module manually by adding value 'MassimoFilippi\SmsModule' to array in file config/modules.config.php. At the end, it should look like PHP array below., (*7)

<?php

return [
    'Zend\Router',
    'Zend\Validator',
    'MassimoFilippi\SmsModule', // Add this line, ideally before Application module.
    'Application',
];

3. Set up your configuration

You have to set settings for SmsService, otherwise you will not be able to use it., (*8)

Here is what I have in my config/autoload/local.php file., (*9)

Warning: DO NOT set passwords in files that are versioned!, (*10)

<?php

return [
    'massimo_filippi' => [
        'sms_module' => [
            'adapter' => \MassimoFilippi\SmsModule\Adapter\SmsApiCom\SmsApiComAdapter::class,
            'adapter_params' => [
                'api_username' => 'john.doe',
                'api_password_hash' => '1234567890', // MD5 hash of password in case of SMSApi
            ],
        ],
    ],
];

Usage

Somewhere in business logic classes., (*11)

<?php 

use MassimoFilippi\SmsModule\Message\Message as SmsMessage;

$smsMessage = new SmsMessage();

$smsMessage->setTo('00420123456789');
$smsMessage->setText('Hello World!');

try {
    // Injected MassimoFilippi\SmsModule\Service\SmsService.
    $this->smsService->sendSMS($smsMessage);
} catch (\Exception $exception) {
    var_dump($exception->getMessage());
}

The Versions

27/10 2017

dev-develop

dev-develop https://github.com/massimo-filippi/sms-module

ZF3 module for SMS communication

  Sources   Download

MIT

The Requires

 

27/10 2017

dev-master

9999999-dev https://github.com/massimo-filippi/sms-module

ZF3 module for SMS communication

  Sources   Download

MIT

The Requires

 

27/10 2017

1.0-beta.1

1.0.0.0-beta1 https://github.com/massimo-filippi/sms-module

ZF3 module for SMS communication

  Sources   Download

MIT

The Requires