Skip to content

Instantly share code, notes, and snippets.

@Zeryther
Last active January 20, 2022 12:03
Show Gist options
  • Save Zeryther/14171b5a7927ea4f6aea7bd397748410 to your computer and use it in GitHub Desktop.
Save Zeryther/14171b5a7927ea4f6aea7bd397748410 to your computer and use it in GitHub Desktop.
Sendinblue PHP API - Symfony Service Configuration
# This service config allows you to use the Sendinblue PHP API through the Symfony service container.
# You can autowire any API from your services and controllers.
#
# How to use:
# Run "composer require sendinblue/api-v3-sdk"
# Define your API key with the env variable "SENDINBLUE_KEY".
# Paste the following into your services.yaml:
services:
# Sendinblue
SendinBlue\Client\Configuration: ~
sendinblue_config:
class: SendinBlue\Client\Configuration
factory: ['@SendinBlue\Client\Configuration', 'getDefaultConfiguration']
calls:
- setApiKey: ['api-key', '%env(SENDINBLUE_KEY)%']
SendinBlue\Client\Api\:
resource: '../vendor/sendinblue/api-v3-sdk/lib/Api/'
arguments: [null, '@sendinblue_config']
# The first argument is the HTTP client to use.
# Unfortunately the SendinBlue API requires the use of GuzzleHttp so you can not inject the Symfony HTTP Client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment