{"id":15045119,"url":"https://github.com/fre5h/sinchbundle","last_synced_at":"2025-07-03T15:33:26.641Z","repository":{"id":62507355,"uuid":"44092074","full_name":"fre5h/SinchBundle","owner":"fre5h","description":"📦 Provides integration with Sinch.com SMS API.","archived":false,"fork":false,"pushed_at":"2024-12-31T15:37:12.000Z","size":151,"stargazers_count":18,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-04T08:18:40.994Z","etag":null,"topics":["bundle","php","sinch","sms","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"https://www.sinch.com/docs/sms-rest/index.html","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fre5h.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fre5h"}},"created_at":"2015-10-12T07:44:33.000Z","updated_at":"2025-05-20T21:13:58.000Z","dependencies_parsed_at":"2024-09-25T01:56:00.124Z","dependency_job_id":"be2ca3de-5af3-4b33-8cd1-cf27977221e6","html_url":"https://github.com/fre5h/SinchBundle","commit_stats":{"total_commits":100,"total_committers":2,"mean_commits":50.0,"dds":"0.010000000000000009","last_synced_commit":"829496e81f59e466d4f896497784644cdc545ced"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/fre5h/SinchBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FSinchBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FSinchBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FSinchBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FSinchBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fre5h","download_url":"https://codeload.github.com/fre5h/SinchBundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FSinchBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263350633,"owners_count":23453311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","php","sinch","sms","symfony","symfony-bundle"],"created_at":"2024-09-24T20:51:28.758Z","updated_at":"2025-07-03T15:33:26.610Z","avatar_url":"https://github.com/fre5h.png","language":"PHP","funding_links":["https://github.com/sponsors/fre5h"],"categories":[],"sub_categories":[],"readme":"# SinchBundle\n\n:package: Provides integration with **[Sinch.com](https://www.sinch.com)** SMS API.\n\n\u003e **Currently in development process! Things can be changed at any moment!**\n\n![Sinch Logo](/Resources/images/sinch-logo.png)\n\n[![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/fre5h/SinchBundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/fre5h/SinchBundle/)\n[![Build Status](https://img.shields.io/travis/fre5h/SinchBundle/master.svg?style=flat-square)](https://travis-ci.com/fre5h/SinchBundle)\n[![CodeCov](https://img.shields.io/codecov/c/github/fre5h/SinchBundle.svg?style=flat-square)](https://codecov.io/github/fre5h/SinchBundle)\n[![License](https://img.shields.io/packagist/l/fresh/sinch-bundle.svg?style=flat-square)](https://packagist.org/packages/fresh/sinch-bundle)\n[![Latest Stable Version](https://img.shields.io/packagist/v/fresh/sinch-bundle.svg?style=flat-square)](https://packagist.org/packages/fresh/sinch-bundle)\n[![Total Downloads](https://img.shields.io/packagist/dt/fresh/sinch-bundle.svg?style=flat-square)](https://packagist.org/packages/fresh/sinch-bundle)\n[![StyleCI](https://styleci.io/repos/44092074/shield?style=flat-square)](https://styleci.io/repos/44092074)\n[![Gitter](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg?style=flat-square)](https://gitter.im/fre5h/SinchBundle)\n\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/2303fcfb-2e4b-45b3-8b37-6d1e7598acf4/small.png)](https://insight.sensiolabs.com/projects/2303fcfb-2e4b-45b3-8b37-6d1e7598acf4)\n[![knpbundles.com](http://knpbundles.com/fre5h/SinchBundle/badge-short)](http://knpbundles.com/fre5h/SinchBundle)\n\n## Requirements\n\n* PHP 7.1 *and later*\n* Symfony 4.0 *and later*\n\n## Installation\n\n### Create application for Sinch\n\nSing up in [Sinch.com](https://www.sinch.com) and [create a new app](https://www.sinch.com/dashboard/#/quickstart).\n\n### Add dependency via Composer\n\n```composer req fresh/sinch-bundle='dev-master'```\n\n### Add key and secret to parameters.yml\n\nAdd the following lines to your `parameters.yml.dist` file:\n\n```yml\nparameters:\n    sinch.key: EnterKeyForYourSinchApp\n    sinch.secret: EnterSecretForYourSinchApp\n```\n\nDuring the composer update you have to enter your own key and secret for your Sinch application,\nwhich you can find in your [Sinch dashboard](https://www.sinch.com/dashboard/#/apps).\n\n### Update config.yml\n\nAdd the following lines to `config.yml` file:\n\n```yml\nfresh_sinch:\n    key: \"%sinch.key%\"\n    secret: \"%sinch.secret%\"\n```\n\n## Usage\n\n### Example of sending SMS\n\n```php\nuse Fresh\\SinchBundle\\Service\\Sinch;\n\nclass Foo {\n    public function bar(Sinch $sinch) {\n        // Set the outbound number where you want to send the SMS\n        $messageId = $sinch-\u003esendSMS('+13155555552', 'Your message');\n        \n        // If success then the ID of sent message is returned (it is an integer value)\n        echo $messageId;\n    }\n}\n```\n\n### Example of checking SMS status\n\n```php\nuse Fresh\\SinchBundle\\Service\\Sinch;\n\nclass Foo {\n    public function bar(Sinch $sinch) {\n        $messageId = 123456789; // The ID of Sinch message you get after successful SMS sending\n        \n        // Status is a string with one of these values: pending, successful, faulted, unknown\n        $status = $sinch-\u003egetStatusOfSMS($messageId);\n        \n        // Other helper methods, return true of false\n        $sinch-\u003esmsIsSentSuccessfully($messageId);\n        $sinch-\u003esmsIsPending($messageId);\n        $sinch-\u003esmsIsFaulted($messageId);\n        $sinch-\u003esmsInUnknownStatus($messageId);\n    }\n}\n```\n\n#### Catching and processing Sinch exceptions\n\n```php\nuse Fresh\\SinchBundle\\Exception\\PaymentRequired\\SinchPaymentRequiredException;\nuse Fresh\\SinchBundle\\Service\\Sinch;\n\nclass Foo {\n    public function bar(Sinch $sinch) {\n        try {\n            $messageId = $sinch-\u003esendSMS($phoneNumber, 'Your message');\n            // Some logic related to SMS processing...\n        } catch (SinchPaymentRequiredException $e) {\n            $logger-\u003eerror('SMS was not sent. Looks like your Sinch account run out of money.');\n            // Here you can, for example, send urgent emails to admin users\n            // to notify that your Sinch account run out of money\n        }\n    }\n}\n```\n\n***\n\n## Contributing\n\nSee [CONTRIBUTING](https://github.com/fre5h/SinchBundle/blob/master/.github/CONTRIBUTING.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffre5h%2Fsinchbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffre5h%2Fsinchbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffre5h%2Fsinchbundle/lists"}