2017 © Pedro Peláez
 

symfony-bundle sms-bundle

Sms sending system with different providers

image

yamilovs/sms-bundle

Sms sending system with different providers

  • Tuesday, July 31, 2018
  • by yamilovs
  • Repository
  • 1 Watchers
  • 3 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

SmsBundle

This bundle will help you to implement an sms messages to your project, (*1)

Installation

You can install this bundle by the following command:, (*2)

``` bash $ composer require yamilovs/sms-bundle ^1.0, (*3)


# Configuration You can define as many provider configurations as you want. Available providers are: * [Message Bird](src/Resources/docs/providers/message_bird.md) [messagebird.com] * [Sms Ru](src/Resources/docs/providers/sms_ru.md) [sms.ru] * [Sms Aero](src/Resources/docs/providers/sms_aero.md) [smsaero.ru] * [Sms Discount](src/Resources/docs/providers/sms_discount.md) [iqsms.ru] * [Sms Center](src/Resources/docs/providers/sms_center.md) [smsc.ru] # Usage #### In your controller ```php <?php // src/Controller/FooController.php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Yamilovs\Bundle\SmsBundle\Service\ProviderManager; use Yamilovs\Bundle\SmsBundle\Sms\Sms; class FooController extends Controller { public function barAction(ProviderManager $providerManager) { $sms = new Sms('+12345678900', 'The cake is a lie'); $provider = $providerManager->getProvider('your_provider_name'); $provider->send($sms); } }

If you want to schedule an sms delivery, (*4)

<?php
// src/Controller/FooController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Yamilovs\Bundle\SmsBundle\Service\ProviderManager;
use Yamilovs\Bundle\SmsBundle\Sms\Sms;

class FooController extends Controller
{
    public function barAction(ProviderManager $providerManager)
    {
        // Your selected sms provider
        $provider = $providerManager->getProvider('your_provider_name');

        // Date of sms delivery
        $worldCupStartDate = (new \DateTime("2018:06:30 00:00:00"))->setTimezone(new \DateTimeZone('Europe/London'));
        $remindDate = (new \DateTime())->add(new \DateInterval('PT5M'));

        // Create new delayed sms
        $worldCupStartSms = new Sms('+12345678900', '2018 FIFA World Cup started!', $worldCupStartDate);
        $remindSms = new Sms('+12345678900', 'I will remind you of football', $remindDate);

        // Send delayed delivery to provider
        $provider->send($worldCupStartSms); // will be sent at 2018:06:30 00:00:00
        $provider->send($remindSms); // will be sent after 5 minutes
    }
}



Tips

You can check sms delivery by the following command: bash $ php bin/console yamilovs:sms:delivery:test [your_provider_name] [your_phone_number] [your_message_text], (*5)

The Versions

31/07 2018

dev-master

9999999-dev https://github.com/yamilovs/SmsBundle

Sms sending system with different providers

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yamilov Stepan

sms sms.ru iqsms.ru smsc.ru smsaero.ru

26/07 2018

1.0.1

1.0.1.0 https://github.com/yamilovs/SmsBundle

Sms sending system with different providers

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yamilov Stepan

sms sms.ru iqsms.ru smsc.ru smsaero.ru

15/01 2018

1.0.0

1.0.0.0 https://github.com/yamilovs/ColorCaptchaBundle

Sms sending system with different providers

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yamilov Stepan

sms sms.ru iqsms.ru smsc.ru smsaero.ru