PHPackages                             fresh/sinch-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. [API Development](/categories/api)
4. /
5. fresh/sinch-bundle

AbandonedArchivedSymfony-bundle[API Development](/categories/api)

fresh/sinch-bundle
==================

Provides integration with Sinch.com SMS API.

0.4.0(8y ago)187931[1 PRs](https://github.com/fre5h/SinchBundle/pulls)MITPHPPHP ^7.1.3

Since Jun 15Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/fre5h/SinchBundle)[ Packagist](https://packagist.org/packages/fresh/sinch-bundle)[ Docs](https://github.com/fre5h/SinchBundle)[ RSS](/packages/fresh-sinch-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (6)Used By (0)

SinchBundle
===========

[](#sinchbundle)

📦 Provides integration with **[Sinch.com](https://www.sinch.com)** SMS API.

[![Sinch Logo](/Resources/images/sinch-logo.png)](/Resources/images/sinch-logo.png)

[![Scrutinizer Quality Score](https://camo.githubusercontent.com/5c7f5ff6619c73b77489091feeda25a431e686a56e7ad47a83e61a74dfbac697/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f66726535682f53696e636842756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/fre5h/SinchBundle/)[![CodeCov](https://camo.githubusercontent.com/e5613d9cd797190aaa27c4ac39793d314999c7af5d43888a70a99226e0e2c9d4/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f66726535682f53696e636842756e646c652e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/fre5h/SinchBundle)[![License](https://camo.githubusercontent.com/cca3898d3f13fa896c9c3e8e599b90f25973fad4a2e2b2fa1b6fb4f8f48268b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66726573682f73696e63682d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fresh/sinch-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/58a8b8b37b6ed7a6ae2748573a58bdf7973d86766250eb9ea874d0067419d9ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66726573682f73696e63682d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fresh/sinch-bundle)[![Total Downloads](https://camo.githubusercontent.com/c809ca053ce94aa98ace4f073fdfa285e7a6d1611de760b511abaa18e12af0e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66726573682f73696e63682d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fresh/sinch-bundle)

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

[](#requirements)

- PHP 7.1 *and later*
- Symfony 4.0 *and later*

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

[](#installation)

### Create application for Sinch

[](#create-application-for-sinch)

Sing up in [Sinch.com](https://www.sinch.com) and [create a new app](https://www.sinch.com/dashboard/#/quickstart).

### Add dependency via Composer

[](#add-dependency-via-composer)

`composer req fresh/sinch-bundle='dev-master'`

### Add key and secret to parameters.yml

[](#add-key-and-secret-to-parametersyml)

Add the following lines to your `parameters.yml.dist` file:

```
parameters:
    sinch.key: EnterKeyForYourSinchApp
    sinch.secret: EnterSecretForYourSinchApp
```

During the composer update you have to enter your own key and secret for your Sinch application, which you can find in your [Sinch dashboard](https://www.sinch.com/dashboard/#/apps).

### Update config.yml

[](#update-configyml)

Add the following lines to `config.yml` file:

```
fresh_sinch:
    key: "%sinch.key%"
    secret: "%sinch.secret%"
```

Usage
-----

[](#usage)

### Example of sending SMS

[](#example-of-sending-sms)

```
use Fresh\SinchBundle\Service\Sinch;

class Foo {
    public function bar(Sinch $sinch) {
        // Set the outbound number where you want to send the SMS
        $messageId = $sinch->sendSMS('+13155555552', 'Your message');

        // If success then the ID of sent message is returned (it is an integer value)
        echo $messageId;
    }
}
```

### Example of checking SMS status

[](#example-of-checking-sms-status)

```
use Fresh\SinchBundle\Service\Sinch;

class Foo {
    public function bar(Sinch $sinch) {
        $messageId = 123456789; // The ID of Sinch message you get after successful SMS sending

        // Status is a string with one of these values: pending, successful, faulted, unknown
        $status = $sinch->getStatusOfSMS($messageId);

        // Other helper methods, return true of false
        $sinch->smsIsSentSuccessfully($messageId);
        $sinch->smsIsPending($messageId);
        $sinch->smsIsFaulted($messageId);
        $sinch->smsInUnknownStatus($messageId);
    }
}
```

#### Catching and processing Sinch exceptions

[](#catching-and-processing-sinch-exceptions)

```
use Fresh\SinchBundle\Exception\PaymentRequired\SinchPaymentRequiredException;
use Fresh\SinchBundle\Service\Sinch;

class Foo {
    public function bar(Sinch $sinch) {
        try {
            $messageId = $sinch->sendSMS($phoneNumber, 'Your message');
            // Some logic related to SMS processing...
        } catch (SinchPaymentRequiredException $e) {
            $logger->error('SMS was not sent. Looks like your Sinch account run out of money.');
            // Here you can, for example, send urgent emails to admin users
            // to notify that your Sinch account run out of money
        }
    }
}
```

---

Contributing
------------

[](#contributing)

See [CONTRIBUTING](https://github.com/fre5h/SinchBundle/blob/master/.github/CONTRIBUTING.md) file.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance52

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~188 days

Total

4

Last Release

3059d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.6.0

0.3.0PHP ^7.1.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/815865?v=4)[Artem Henvald](/maintainers/fre5h)[@fre5h](https://github.com/fre5h)

---

Top Contributors

[![fre5h](https://avatars.githubusercontent.com/u/815865?v=4)](https://github.com/fre5h "fre5h (104 commits)")

---

Tags

bundlephpsinchsmssymfonysymfony-bundleapiclientsymfonybundlesmsverificationsinch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fresh-sinch-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/fresh-sinch-bundle/health.svg)](https://phpackages.com/packages/fresh-sinch-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[meilisearch/search-bundle

Seamless integration of Meilisearch into your Symfony project.

154356.2k](/packages/meilisearch-search-bundle)[harmbandstra/swagger-ui-bundle

Exposes swagger UI inside your Symfony project through a route (eg. /docs)

42867.3k](/packages/harmbandstra-swagger-ui-bundle)[artyuum/request-dto-mapper-bundle

This bundle provides an easy way to automatically map the incoming request data to a DTO and optionally validate it.

515.8k](/packages/artyuum-request-dto-mapper-bundle)[stfalcon-studio/api-bundle

Base classes and helper services to build API application via Symfony.

1032.1k](/packages/stfalcon-studio-api-bundle)

PHPackages © 2026

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