PHPackages                             akanunov/easy-sms-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. akanunov/easy-sms-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

akanunov/easy-sms-bundle
========================

Integrates easy-sms library to your Symfony project.

v0.0.7(2mo ago)086MITPHPPHP ^8.1CI failing

Since Sep 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/akanunov/easy-sms-bundle)[ Packagist](https://packagist.org/packages/akanunov/easy-sms-bundle)[ RSS](/packages/akanunov-easy-sms-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

Installation
============

[](#installation)

Step 1: Download the Bundle
---------------------------

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require akanunov/easy-sms-bundle
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Step 2: Enable the Bundle
-------------------------

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `app/AppKernel.php` file of your project:

```
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Akanunov\EasySmsBundle\AkanunovEasySmsBundle(),
        ];

        // ...
    }

    // ...
}
```

Step 3: Configure your SMS gateways
-----------------------------------

[](#step-3-configure-your-sms-gateways)

```
# app/config/config.yml
akanunov_easy_sms:
    gateways:
      aliyun:
        access_key_id:        "%aliyun_access_key%"
        access_key_secret:    "%aliyun_key_secret%"
        sign_name:            "%aliyun_sign_name%"
    default:
        gateways: ['aliyun']
```

For more details on the other parameters, take a look at the [Easy SMS documentation](https://github.com/overtrue/easy-sms).

Step 4: Configure custom SMS gateway
------------------------------------

[](#step-4-configure-custom-sms-gateway)

Update configuration file:

```
# app/config/config.yml
akanunov_easy_sms:
    gateways:
        mygateway:
            api_key: "%mygateway_api_key%"
    default:
        gateways: ['mygateway']
    custom_gateways:
        mygateway:
          gateway_class: App\EasySms\Gateways\MyGateway
          configuration_factory_class: App\DependencyInjection\Factory\Gateway\MyGatewayFactory
```

Create gateway configuration factory:

```
