2017 © Pedro Peláez
 

library symfony-sms-delivery-bundle

Symfony Bundle SMS sending service

image

scaytrase/symfony-sms-delivery-bundle

Symfony Bundle SMS sending service

  • Wednesday, March 29, 2017
  • by scaytrase
  • Repository
  • 1 Watchers
  • 5 Stars
  • 8,094 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 15 Versions
  • 10 % Grown

The README.md

scaytrase/symfony-sms-delivery-bundle

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Monthly Downloads Daily Downloads, (*2)

This Symfony bundle provides basic service for sending short messages. This bundle does not provide you any finished implementation for communicating the SMS gateway. To use it you have use some transport implementation or implement a transport on your own. See usage section for known implementations, (*3)

Features

Current features

  • [x] Service and configurable transports
  • [x] Ability to disable delivery via config for testing purposes
  • [x] Ability to force redirect messages for testing purposes
  • [x] Profiling via Sf2 Toolbar
  • [x] Spooling and delayed sending

Planned features

  • [ ] Bulk sending

Installation

This bunde could be installed via Composer, (*4)

composer require scaytrase/symfony-sms-delivery-bundle:~2.0

app/AppKernel.php

update your kernel bundle requirements as follows:, (*5)

$bundles = array(
    //....
    new ScayTrase\SmsDeliveryBundle\SmsDeliveryBundle(),
    //....
    );

Configuration

Below is the configuration example and their default values, (*6)

sms_delivery:
    spool: sms_delivery.spool.instant
    transport: sms_delivery.dummy_sender # @id of the transport service 
    disable_delivery: false # disable delivery overrides spool with disabled spool
    delivery_recipient: null # delivery recipient overrides recipient when sending

Usage

To use this interface you must create a message class implementing ShortMessageInterface and create the implementation of the TransportInterface that delivers your message to end point sms gateway. You can refer my WebSMS gateway implementation as a reference., (*7)

Example

class MyMessage implements ShortMessageInterface { /*...*/ }

class SmsController extends Controller {

  public function sendSmsAction()
  {
    $message = new MyMessage('5552368','Help!')
    $sender = $this->get('sms_delivery.sender');
    $sender->spoolMessage($message);
    $result = $sender->flush();
    return new Response('Delivery '. $result ? 'successful' : 'failed');
  }
}

Standalone usage

Despite of the fact that this library is designed as Symfony bundle it could be used as standalone library for sending short messages. You should just instantiate sender service on your own., (*8)


class MyProviderSmsTransport implements TransportInterface { /*...*/ } class MyMessage implements ShortMessageInterface { /*...*/ } $transport = new MyProviderSmsTransport(); $sender = new MessageDeliveryService($transport); $sender->spoolMessage(new MyMessage('Message body')); $sender->flush(); // Default InstantSpool does not actually needs flushing but you can use another spool instead

The Versions

29/03 2017
06/12 2015
31/08 2015

2.0.0

2.0.0.0

Symfony2 Bundle with service for sending sms

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Pavel Batanov

12/08 2015

2.0.0-alpha

2.0.0.0-alpha

Symfony2 Bundle with service for sending sms

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Pavel Batanov

22/07 2015

1.0.1

1.0.1.0

Symfony2 Bundle with service for sending sms

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Pavel Batanov

21/07 2015

1.0

1.0.0.0

Symfony2 Bundle with service for sending sms

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Pavel Batanov

21/07 2015

1.0-alpha1

1.0.0.0-alpha1

Symfony2 Bundle with simple interface for sending sms

  Sources   Download

GPLv2

The Requires

 

The Development Requires

by Pavel Batanov

12/12 2014

0.2.1-beta22

0.2.1.0-beta22

Symfony2 Bundle with simple interface for sending sms

  Sources   Download

GPLv2

The Requires

 

The Development Requires

by Pavel Batanov

02/08 2014

0.2.1-beta17

0.2.1.0-beta17

Symfony2 Bundle with simple interface for sending sms

  Sources   Download

GPLv2

The Requires

 

by Pavel Batanov