PHPackages                             shershennm/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. shershennm/yii2-sendgrid

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

shershennm/yii2-sendgrid
========================

Sendgrid Mailer for Yii 2

3.1.1(6y ago)7135.5k↓12%81MITPHP

Since Nov 24Pushed 6y ago2 watchersCompare

[ Source](https://github.com/shershennm/yii2-sendgrid)[ Packagist](https://packagist.org/packages/shershennm/yii2-sendgrid)[ RSS](/packages/shershennm-yii2-sendgrid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (18)Used By (1)

Yii 2 shershennm SendGrid
=========================

[](#yii-2-shershennm-sendgrid)

Sendgrid Mailer for Yii 2

> forked from [bryglen/yii2-sendgrid](https://github.com/bryglen/yii2-sendgrid.git)

**3.1.0 update**

Methods which returned `\SendGrid\Mail\EmailAddress` or array with this type, now returns plain email string or `['email' => 'name']` array or array with this values.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist shershennm/yii2-sendgrid "^3.1"

```

or add

```
"shershennm/yii2-sendgrid": "^3.1"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

To use Mailer, you should configure it in the application configuration like the following,

```
'components' => [
	...
	'sendGrid' => [
		'class' => 'shershennm\sendgrid\Mailer',
		'apiKey' => 'your api key',
	]
	...
],
```

To send an email, you may use the following code:

```
$sendGrid = Yii::$app->sendGrid;
$message = $sendGrid->compose('contact/html', ['contactForm' => $form])
$message->setFrom('from@domain.com')
	->setTo($form->email)
	->setSubject($form->subject)
	->send($sendGrid);
	//also you can use sendgrid substitutions
	->setSendGridSubstitution('template id', [
		':var1' => 'var1value',
		':var2' => 'var2value',
	]);
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 64.3% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~109 days

Recently: every ~31 days

Total

16

Last Release

2549d ago

Major Versions

1.1.4 → 2.0.02015-12-21

2.0.2 → 3.0.02018-12-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/00fc0eb85f1bbaef626c2ec21770df3a7c5c32fee8f90e822242cc69c8ccb234?d=identicon)[shershennm](/maintainers/shershennm)

---

Top Contributors

[![shershennm](https://avatars.githubusercontent.com/u/1130311?v=4)](https://github.com/shershennm "shershennm (27 commits)")[![bryglen](https://avatars.githubusercontent.com/u/875604?v=4)](https://github.com/bryglen "bryglen (12 commits)")[![p1umbum](https://avatars.githubusercontent.com/u/24696989?v=4)](https://github.com/p1umbum "p1umbum (2 commits)")[![thiagotalma](https://avatars.githubusercontent.com/u/612578?v=4)](https://github.com/thiagotalma "thiagotalma (1 commits)")

---

Tags

emailssendgridsendgrid-phpyii2yii2-extensionsendgridyii2extensionshershennm

###  Code Quality

TestsCodeception

### Embed Badge

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

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

###  Alternatives

[nterms/yii2-mailqueue

Email queue component for yii2 that works with yii2-swiftmailer.

87129.2k2](/packages/nterms-yii2-mailqueue)[bryglen/yii2-sendgrid

Sendgrid Mailer for Yii 2

1353.5k](/packages/bryglen-yii2-sendgrid)

PHPackages © 2026

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