PHPackages                             devcodesms/devcode-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. [HTTP &amp; Networking](/categories/http)
4. /
5. devcodesms/devcode-sms-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

devcodesms/devcode-sms-bundle
=============================

Symfony bundle for the DevCode SMS API. Send SMS messages and check your balance directly from your Symfony application.

00PHP

Since Apr 1Pushed 3mo agoCompare

[ Source](https://github.com/devcodegroupe/dependency-devcode-sms-composer)[ Packagist](https://packagist.org/packages/devcodesms/devcode-sms-bundle)[ RSS](/packages/devcodesms-devcode-sms-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

DevCode SMS Bundle
==================

[](#devcode-sms-bundle)

Symfony bundle for the [DevCode SMS API](https://devcodesms.com/en/documentation).
Send SMS messages and check your balance directly from your Symfony application.

[![Packagist Version](https://camo.githubusercontent.com/825c4ea075f6f649b81b2dab0ee91aaaeb6cb56ba0bc54dc5d82ad00fdc14e24/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646576636f6465736d732f646576636f64652d736d732d62756e646c65)](https://packagist.org/packages/devcodesms/devcode-sms-bundle)[![License: BSD-3-Clause](https://camo.githubusercontent.com/72e6bab5bd8fc6c3dd0bd3394af1b458026b9b5e560e49e0d7b88daf11667205/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4253442d2d332d2d436c617573652d626c75652e737667)](LICENSE)[![PHP >= 8.1](https://camo.githubusercontent.com/7663c9d53dc13cedaf0660a8745a7e77d2dd711257f36aa86ebce12a0600ef42/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c75652e737667)](https://php.net)[![Symfony ^6|^7](https://camo.githubusercontent.com/76ce44bd4cf7646bad490d7e19e8bf6b46da0e62d3d113652e1eb646a5aa5df5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d36253230253743253230372d626c61636b2e737667)](https://symfony.com)

---

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Symfony 6.x or 7.x

---

Installation
------------

[](#installation)

```
composer require devcodesms/devcode-sms-bundle
```

---

Setup
-----

[](#setup)

### 1. Register the bundle

[](#1-register-the-bundle)

Add to `config/bundles.php` (Symfony Flex does this automatically):

```
return [
    // ...
    DevcodeSms\Bundle\DevcodeSmsBundle::class => ['all' => true],
];
```

### 2. Add your API key to `.env`

[](#2-add-your-api-key-to-env)

```
DEVCODE_SMS_API_KEY=your_api_key_here
```

### 3. Create the config file

[](#3-create-the-config-file)

Create `config/packages/devcode_sms.yaml`:

```
devcode_sms:
    api_key: '%env(DEVCODE_SMS_API_KEY)%'
    # Optional:
    # base_url: 'https://devcodesms.com/developpeur'
    # timeout: 10
```

---

Usage
-----

[](#usage)

### Inject the client into your service or controller

[](#inject-the-client-into-your-service-or-controller)

```
use DevcodeSms\Bundle\DevcodeSmsClient;
use DevcodeSms\Bundle\Exception\DevcodeSmsException;

class NotificationService
{
    public function __construct(private DevcodeSmsClient $sms) {}

    public function sendWelcome(string $phone): void
    {
        try {
            $result = $this->sms->sendSms(
                sender:  'MyApp',
                phone:   $phone,           // International format: +237659373726
                message: 'Bienvenue sur MyApp!',
            );

            if ($result->isSuccess()) {
                // SMS accepted by the API
            }
        } catch (DevcodeSmsException $e) {
            // Network or API error
            echo $e->getMessage();
        }
    }
}
```

### Send bulk SMS

[](#send-bulk-sms)

```
$results = $this->sms->sendBulkSms(
    sender:  'MyApp',
    phones:  ['+237659000001', '+237659000002', '+237659000003'],
    message: 'Offre flash — 20% de réduction aujourd\'hui!',
);

foreach ($results as $result) {
    echo $result->isSuccess() ? '✅' : '❌';
    echo ' ' . $result->getMessage() . PHP_EOL;
}
```

### Check balance

[](#check-balance)

```
$balance = $this->sms->getBalance();

if ($balance->isSuccess()) {
    echo sprintf('Crédits restants : %d SMS', $balance->getBalance());
}
```

---

Configuration reference
-----------------------

[](#configuration-reference)

```
# config/packages/devcode_sms.yaml
devcode_sms:
    api_key:  '%env(DEVCODE_SMS_API_KEY)%'  # required
    base_url: 'https://devcodesms.com/developpeur'  # optional
    timeout:  10  # optional, seconds (default: 10)
```

---

API Reference
-------------

[](#api-reference)

### `DevcodeSmsClient`

[](#devcodesmsclient)

MethodReturnsDescription`sendSms(string $sender, string $phone, string $message)``SmsResponse`Send a single SMS`sendBulkSms(string $sender, array $phones, string $message)``SmsResponse[]`Send to multiple recipients`getBalance()``BalanceResponse`Check remaining credits### `SmsResponse`

[](#smsresponse)

MethodTypeDescription`isSuccess()``bool``true` when status is 200`getStatus()``int`HTTP-like status code`getCode()``string`Short status string`getMessage()``string`Human-readable message`toArray()``array`Serialise to array### `BalanceResponse`

[](#balanceresponse)

MethodTypeDescription`isSuccess()``bool``true` when status is 200`getBalance()``int`Remaining SMS credits`getMessage()``string`Human-readable message`toArray()``array`Serialise to array### `DevcodeSmsException`

[](#devcodesmsexception)

MethodTypeDescription`getMessage()``string`Human-readable description`getStatusCode()``int|null`HTTP code or null for network errors`getRawResponse()``string|null`Raw server response body---

Running tests
-------------

[](#running-tests)

```
composer install
./vendor/bin/phpunit
```

---

Get your API key
----------------

[](#get-your-api-key)

1. Create an account at [devcodesms.com](https://devcodesms.com/en/sign-up)
2. Subscribe to an SMS plan
3. Generate your key in the **API Key** section

---

Support
-------

[](#support)

- 📧
- 📞 (+237) 659 373 726
- 🌐 [devcodesms.com](https://devcodesms.com)

---

License
-------

[](#license)

[BSD-3-Clause](LICENSE) © 2024 DevCode SMS

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance55

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0392100ca68e9343d733d50f28cff2444a6362cbcc2a5285f593795bd3ef2d8b?d=identicon)[devcodegroupe](/maintainers/devcodegroupe)

---

Top Contributors

[![devcodegroupe](https://avatars.githubusercontent.com/u/172364313?v=4)](https://github.com/devcodegroupe "devcodegroupe (1 commits)")

### Embed Badge

![Health badge](/badges/devcodesms-devcode-sms-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/devcodesms-devcode-sms-bundle/health.svg)](https://phpackages.com/packages/devcodesms-devcode-sms-bundle)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M90](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
