2017 © Pedro PelĂĄez
 

symfony-bundle sendinblue-bundle

Symfony SendinblueBundle

image

allprogrammic/sendinblue-bundle

Symfony SendinblueBundle

  • Friday, November 3, 2017
  • by wpottier
  • Repository
  • 1 Watchers
  • 1 Stars
  • 127 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

AllProgrammic SendinBlue Bundle

This bundle provides integration and api client of the sendinblue mail broker with Symfony, (*1)

Installation

Get the dependence in your project, (*2)

composer require allprogrammic/sendinblue-bundle

Enable the bundle. In your AppKernel.php, (*3)

public function registerBundles()
{
    $bundles = [
        // ...
        new AllProgrammic\Bundle\SendinBlueBundle\AllProgrammicSendinBlueBundle(),
        // ...
    ];
}

Configuration

Get your sendinblue API key here, and add it to your config.yml, (*4)

sendinblue:
    api:
        key: 'your key'

You may also want to set it through your parameters.yml file., (*5)

parameters.yml, (*6)

parameters:
  sendinblue_api_key: 'your key'

config.yml, (*7)

sendinblue:
    api:
        key: '%sendinblue_api_key%'

Usage

This bundle provide a service 'sendinblue.api.client' to interact with the sendinblue api., (*8)

Example : retrieve your account data

$this->get('sendinblue.api.client')->getAccount();

Example : send a transactional message

$message = new \AllProgrammic\Bundle\SendinBlueBundle\Api\TransactionalMessage('my subject');
$message
    ->from('test@test.com', 'My Company')
    ->addTo('john.doe@acme.com')
    ->html($this->renderView('mytemplate.html.twig'))
    ->text($this->renderView('mytemplate.txt.twig'));

$this->get('sendinblue.api.client')->sendTransactional(message);

The Versions