NOTE:
This package has been deprecated. As an alternative, sendinblue/api-v3-sdk
can be used to integrate Sendinblue APIs.
This package will be archived on 31st October 2020 at 00:00:00 UTC.
This bundle integrates sendinblue/api-v3-sdk
into Symfony.
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require sendinblue/api-bundle "~1"
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new SendinBlue\Bundle\ApiBundle\SendinBlueApiBundle(),
);
// ...
}
// ...
}
sendinblue_api:
endpoints: []
key: ~
You’ll define the API client key under sendinblue_api.key
.
Then you’ll need to otp-in for the endpoints you want to access. One service will be created per endpoint:
- account
- attributes
- contacts
- email_campaigns
- folders
- lists
- process
- reseller
- senders
- sms_campaigns
- smtp
- transactional_sms
- webhooks
The service names will be sendinblue_api.%s_endpoint
where %s
is a value from the list above. The corresponding classes can be found under the SendinBlue\Client\Api
namespace.
/** @var SendinBlue\Client\Api\AccountApi $accountEndpoint */
$accountEndpoint = $this->get('sendinblue_api.account_endpoint');
To use more than one client you must move key
and endpoints
parameter under a clients
associative array. Each client will be named by its key.
sendinblue_api:
clients:
first:
endpoints:
- account
key: ~
second:
endpoints:
- account
key: ~
To access the first client account endpoint you’ll get the sendinblue_api.first_client.account_endpoint
service.
You can define a default client through the default_client
parameter; by default it is the first defined client. You can access the default client endpoints without adding its name in the service name. In the above example the sendinblue_api.account_endpoint
service would be an alias of sendinblue_api.first_client.account_endpoint
.
If you write
sendinblue_api:
default_client: second
clients:
first:
endpoints:
- account
key: ~
second:
endpoints:
- account
key: ~
then sendinblue_api.account_endpoint
will be an alias of sendinblue_api.second_client.account_endpoint
.