Developed with love by KnpLabs Hire us for your project!
23

sendinblue-api-bundle

by mailin-api

Official Sendinblue provided API V2 Symfony 2.x & 3.x Bundle

SendinBlue Symfony Bundle

This is SendinBlue provided API V2 Symfony Bundle. It implements the various exposed APIs that you can read more about on https://apidocs.sendinblue.com.

Prerequisites

This version of the bundle requires Symfony 2.x OR 3.x.

Installation

Download SendinBlueApiBundle using composer

Add SendinBlueApiBundle in your composer.json:

{
"require": {
"sendinblue/sendinblue-api-bundle": "2.0.*"
}
}

Now tell composer to download the bundle by running the command:

$ composer update

OR

Simply install by running below command

$ composer require "sendinblue/sendinblue-api-bundle"

Composer will install the bundle to your project's vendor/sendinblue directory.

Enable the Bundle

In the kernel app/AppKernel.php:

<?php

public function registerBundles()
{
    $bundles = array(
        // ...
        new SendinBlue\SendinBlueApiBundle\SendinBlueApiBundle(),
    );
}

Add SendinBlue Api key

In your app/config/config.yml:

sendin_blue_api:
    api_key: <Your access key>
    # Our library supports a timeout value, which is an optional parameter, default is 30,000 MS ( 30 secs )
    timeout: 5000

Usage

The API is available with the sendinblue_api service.
To access it, add in your controller (or elsewhere):

<?php
$sendinblue = $this->get('sendinblue_api');

Example

Get your account information

<?php
$sendinblue = $this->get('sendinblue_api');

$result = $sendinblue->get_account();
// var_dump($result);

To send email

<?php

$sendinblue = $this->get('sendinblue_api');

$data = array( "to" => array("to@example.net"=>"to whom!"),
    "cc" => array("cc@example.net"=>"cc whom!"),
    "bcc" => array("bcc@example.net"=>"bcc whom!"),
    "replyto" => array("replyto@email.com","reply to!"),
    "from" => array("from@email.com","from email!"),
    "subject" => "My subject",
    "text" => "This is the text",
    "html" => "This is the <h1>HTML</h1><br/>
               This is inline image 1.<br/>
               <img src=\"{myinlineimage1.png}\" alt=\"image1\" border=\"0\"><br/>
               Some text<br/>
               This is inline image 2.<br/>
               <img src=\"{myinlineimage2.jpg}\" alt=\"image2\" border=\"0\"><br/>
               Some more text<br/>
               Re-used inline image 1.<br/>
               <img src=\"{myinlineimage1.png}\" alt=\"image3\" border=\"0\">",
    "attachment" => array(),
    "headers" => array("Content-Type"=> "text/html; charset=iso-8859-1","X-param1"=> "value1", "X-param2"=> "value2","X-Mailin-custom"=>"my custom value", "X-Mailin-IP"=> "102.102.1.2", "X-Mailin-Tag" => "My tag"),
    "inline_image" => array("myinlineimage1.png" => "your_png_files_base64_encoded_chunk_data","myinlineimage2.jpg" => "your_jpg_files_base64_encoded_chunk_data")
);

$result = $sendinblue->send_email($data);
// var_dump($result);

Support and Feedback

Be sure to visit the SendinBlue official documentation website for additional information about our API.

If you find a bug, please submit the issue in Github directly.

As always, if you need additional assistance, drop us a note here.

sendinblue_api:
api_key: ~ # Required
timeout: 30000
  • Bug fix: missed api key in headers
    By , 1 year ago
  • Merge pull request #7 from MatTheCat/master
    By web-flow, 1 year ago
  • simplify do_request
    By MatTheCat, 1 year ago
  • fix variables usage
    By MatTheCat, 1 year ago
  • leverage Symfony configuration
    By MatTheCat, 1 year ago
  • remove default comments
    By MatTheCat, 1 year ago
  • code style
    By MatTheCat, 1 year ago
  • Merge pull request #6 from bgatellier/master
    By web-flow, 1 year ago
  • Remove deprecations for the next Symfony 4
    By bgatellier, 2 years ago
  • Merge remote-tracking branch 'refs/remotes/mailin-api/master'
    By bgatellier, 2 years ago
  • API-38: Added default timeout of 30 secs
    By ekta-slit, 2 years ago
  • Updated composer file
    By ekta-slit, 2 years ago
  • API-20: Bundle parameter defined in configuration file
    By ekta-slit, 2 years ago
  • API-20: Modified Wrapper file
    By ekta-slit, 2 years ago
  • API-20: Bundle compatible with both Symfony 2 & 3
    By ekta-slit, 2 years ago
  • HOT-49: delete attribute API no response issue fixed
    By ekta-slit, 2 years ago
  • SendinBlue Api Bundle for symfony3
    By ekta-slit, 2 years ago
  • Merge pull request #4 from bgatellier/master
    By SendinBlue, 2 years ago
  • Correct bug when Mailin constructor thrown an Exception
    By bgatellier, 2 years ago
  • updated readme
    By ekta-slit, 2 years ago
  • updated readme
    By ekta-slit, 2 years ago
  • Merge pull request #2 from Nek-/patch-1
    By SendinBlue, 2 years ago
  • modified sender_update() function in wrapper
    By ekta-slit, 2 years ago
  • Updated input parameters notes in wrapper
    By ekta-slit, 2 years ago
  • Update README.md
    By Nek-, 3 years ago
  • Readme update
    By ekta-slit, 3 years ago
  • composer update
    By ekta-slit, 3 years ago
  • composer update
    By ekta-slit, 3 years ago
  • composer update
    By ekta-slit, 3 years ago
  • Initial commit
    By ekta-slit, 3 years ago