PHPackages                             oskargunther/sendgrid-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. oskargunther/sendgrid-bundle

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

oskargunther/sendgrid-bundle
============================

Integrates sendgrid-php with Symfony &gt;=2.8 with extra message profiling

1.5.10(6y ago)3672MITPHPPHP &gt;=7.1

Since Aug 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/oskargunther/sendgrid-bundle)[ Packagist](https://packagist.org/packages/oskargunther/sendgrid-bundle)[ RSS](/packages/oskargunther-sendgrid-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (9)Versions (50)Used By (0)

Readme
======

[](#readme)

Symfony &gt;=2.8 SendGrid Bundle
================================

[](#symfony-28-sendgrid-bundle)

Documentation
-------------

[](#documentation)

### Features

[](#features)

1. Configure sendgrid-php through yaml
2. Disable delivery through parameter
3. WebProfiler Extension
4. WebHook events dispatcher
5. Redirect all messages to specific address

Using the Bundle.
-----------------

[](#using-the-bundle)

### Installation:

[](#installation)

```
composer require oskargunther/sendgrid-bundle

```

### Add bundle to kernel:

[](#add-bundle-to-kernel)

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            ....
            new OG\SendGridBundle\OGSendGridBundle(),
        ];

    }
}
```

### Configuration:

[](#configuration)

- config.yml

```
og_send_grid:
    api_key: string
    disable_delivery: false # default false
```

- config\_dev.yml

```
og_send_grid:
    web_profiler: true # default %kernel.debug% (enabled)
    redirect_to: test@test.com # default false
```

### Usage:

[](#usage)

```
use OG\SendGridBundle\Exception\SendGridException;

$provider = $this->get('og_send_grid.provider');

$email = $provider->createMessage();

$email->setFrom("test@test.pl", "Example User");
$email->setSubject("Test subject");
$email->addTo("o.gunther@test.pl", "Example User");
$email->addContent("text/plain", "and easy to do anywhere, even with PHP");
$email->addContent("text/html", "
