flosch/messagebird-bundle

Symfony 3 bundle to easily integrate MessageBird SDK into a Symfony project.

Installs: 774

Dependents: 0

Suggesters: 0

Security: 0

Type:symfony-bundle

0.1.0 2017-02-03 20:24 UTC

This package is not auto-updated.

Last update: 2020-01-14 20:53:50 UTC


README

A symfony 3 integration for the MessageBird PHP SDK

This bundle allow you to manipulate the MessageBird SDK as a Symfony service.

Installation

To install this bundle, run the command below and you will get the latest version from Packagist.

composer require flosch/messagebird-bundle

Load required bundles in AppKernel.php:

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // [...]
        new Flosch\Bundle\MessageBirdBundle\FloschMessageBirdBundle()
    );
}

And set-up the required configuration

# app/config/config.yml
flosch_message_bird:
    api_key: "xxxxxxxxxxxxxxxxx" # The MessageBird API key can be added as a symfony parameter

Usage

Then, it is possible to use this service from inside a controller

$messageBirdClient = $this->get('flosch.message_bird.client');

The MessageBirdClient php class extends the default MessageBird PHP SDK class, allowing you to do anything that this SDK can do. Plus, it will automatically be authenticated with your MessageBird API Key, which you do not have to worry about at all.