allprogrammic / sendinblue-bundle
Symfony SendinblueBundle
Installs: 685
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^5.5.9 || ^7.0
- guzzlehttp/guzzle: ^6.2
- symfony/framework-bundle: ^2.7 || ^3.0 || ^4.0
- symfony/serializer: ^2.7 || ^3.0 || ^4.0
This package is auto-updated.
Last update: 2024-11-17 20:35:18 UTC
README
This bundle provides integration and api client of the sendinblue mail broker with Symfony
Installation
Get the dependence in your project
composer require allprogrammic/sendinblue-bundle
Enable the bundle. In your AppKernel.php
public function registerBundles() { $bundles = [ // ... new AllProgrammic\Bundle\SendinBlueBundle\AllProgrammicSendinBlueBundle(), // ... ]; }
Configuration
Get your sendinblue API key here, and add it to your config.yml
sendinblue: api: key: 'your key'
You may also want to set it through your parameters.yml file.
parameters.yml
parameters: sendinblue_api_key: 'your key'
config.yml
sendinblue: api: key: '%sendinblue_api_key%'
Usage
This bundle provide a service 'sendinblue.api.client' to interact with the sendinblue api.
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);