PHPackages                             dutchakdev/yii2-sendgrid - 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. dutchakdev/yii2-sendgrid

AbandonedArchivedYii2-extension

dutchakdev/yii2-sendgrid
========================

PHP 5.6+ Sendgrid integration for the Yii framework

1105PHP

Since Mar 25Pushed 8y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Sendgrid Yii2 integration
=========================

[](#sendgrid-yii2-integration)

This extension allow the developper to use [Sendgrid](https://sendgrid.com/) as an email transport.

[![Latest Stable Version](https://camo.githubusercontent.com/3961bdea2a933edbea71f172275aa68b53b93ff59e6fbfd15cd30eb9f16bca32/68747470733a2f2f706f7365722e707567782e6f72672f6475746368616b6465762f796969322d73656e64677269642f762f737461626c65)](https://packagist.org/packages/dutchakdev/yii2-sendgrid)[![Build Status](https://camo.githubusercontent.com/ea6c829cca65f3c96981ea522a9085481722ba6367ea063734038bf2e1c6480a/68747470733a2f2f6170692e7472617669732d63692e6f72672f706761756c746965722f796969322d73656e64677269642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pgaultier/yii2-sendgrid)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/79b325cd532056989db189b0b2a2b7d1662442a40c329f46d998c8bd1e4377a8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706761756c746965722f796969322d73656e64677269642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pgaultier/yii2-sendgrid/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/f9bae13e427131eec6a1fe8f78432a052a5684ae2fd7fd480764e47fbf2e4d68/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706761756c746965722f796969322d73656e64677269642f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pgaultier/yii2-sendgrid/?branch=master)[![License](https://camo.githubusercontent.com/98956d84d5e625f87d8da9f7742e67b1b9c1ef61f38f58ccab73e43cc6b1d96b/68747470733a2f2f706f7365722e707567782e6f72672f6475746368616b6465762f796969322d73656e64677269642f6c6963656e7365)](https://packagist.org/packages/dutchakdev/yii2-sendgrid)

[![Latest Development Version](https://camo.githubusercontent.com/da9290457cc26b65f8faba577f924f94512f24929311567c357a38320d6772fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f756e737461626c652d646576656c2d79656c6c6f77677265656e2e737667)](https://packagist.org/packages/dutchakdev/yii2-sendgrid)[![Build Status](https://camo.githubusercontent.com/c3e914405dd9c00112b0311ede294d79dea684aefdecc9cc206de665a63529a4/68747470733a2f2f7472617669732d63692e6f72672f706761756c746965722f796969322d73656e64677269642e7376673f6272616e63683d646576656c)](https://travis-ci.org/pgaultier/yii2-sendgrid)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0eefa7de7c2945967feb32924967b8aa31eff0c3ac1a9a35c4fd93d40e37606a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706761756c746965722f796969322d73656e64677269642f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c)](https://scrutinizer-ci.com/g/pgaultier/yii2-sendgrid/?branch=devel)[![Code Coverage](https://camo.githubusercontent.com/4308dd73313fe3d3deaad0cbd2290e995f39ec00dbd3801b3144ada3a7e7d703/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706761756c746965722f796969322d73656e64677269642f6261646765732f636f7665726167652e706e673f623d646576656c)](https://scrutinizer-ci.com/g/pgaultier/yii2-sendgrid/?branch=devel)

Installation
------------

[](#installation)

If you use Packagist for installing packages, then you can update your composer.json like this :

```
{
    "require": {
        "dutchakdev/yii2-sendgrid": "*"
    }
}
```

Howto use it
------------

[](#howto-use-it)

Add extension to your configuration

```
return [
    //....
    'components' => [
        'mailer' => [
            'class' => 'dutchakdev\sendgrid\Mailer',
            'token' => '',
        ],
    ],
];
```

You can send email as follow (using postmark templates)

```
Yii::$app->mailer->compose('contact/html')
     ->setFrom('from@domain.com')
     ->setTo($form->email)
     ->setSubject($form->subject)
     ->setTemplateId(12345)
     ->setTemplateModel([
         'firstname' => $form->firstname,
         'lastname' => $form->lastname,
     ->send();
```

For further instructions refer to the [related section in the Yii Definitive Guide](http://www.yiiframework.com/doc-2.0/guide-tutorial-mailing.html)

Running the tests
-----------------

[](#running-the-tests)

Before running the tests, you should edit the file tests/\_bootstrap.php and change the defines :

```
// ...
define('SENDGRID_FROM', '');
define('SENDGRID_TOKEN', '');
define('SENDGRID_TO', '');
define('SENDGRID_TEMPLATE', 575741);

define('SENDGRID_TEST_SEND', false);
// ...
```

to match your [Sendgrid](https://sendgrid.com/) configuration.

Contributing
------------

[](#contributing)

All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.

Fork the project, create a [feature branch ](http://nvie.com/posts/a-successful-git-branching-model/), and send us a pull request.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f4fef37a9b2ed17cb987a556655b35d6e97ff9f7816c53c9d5541b7df423d4c?d=identicon)[dutchakdev](/maintainers/dutchakdev)

### Embed Badge

![Health badge](/badges/dutchakdev-yii2-sendgrid/health.svg)

```
[![Health](https://phpackages.com/badges/dutchakdev-yii2-sendgrid/health.svg)](https://phpackages.com/packages/dutchakdev-yii2-sendgrid)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
