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

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

thiagotalma/yii2-sendgrid
=========================

Sendgrid Mailer for Yii2

v0.1(9y ago)05.1kMITPHP

Since Aug 29Pushed 8y ago2 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

yii2-sendgrid
=============

[](#yii2-sendgrid)

Sendgrid Mailer for Yii2

> based on [shershennm/yii2-sendgrid](https://github.com/shershennm/yii2-sendgrid.git)

[![Latest Stable Version](https://camo.githubusercontent.com/492cd15eb9ded43895fcb74d6352d6a140f123af95f675a5fa23214d7938fa8b/68747470733a2f2f706f7365722e707567782e6f72672f74686961676f74616c6d612f796969322d73656e64677269642f762f737461626c652e706e67)](https://packagist.org/packages/thiagotalma/yii2-sendgrid)[![Total Downloads](https://camo.githubusercontent.com/9e4c8b50b2e16355a34f3ccd1a00168b260b6ea30b9a598bb6dc229da87793a6/68747470733a2f2f706f7365722e707567782e6f72672f74686961676f74616c6d612f796969322d73656e64677269642f646f776e6c6f6164732e706e67)](https://packagist.org/packages/thiagotalma/yii2-sendgrid)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist thiagotalma/yii2-sendgrid "*"

```

or add

```
"thiagotalma/yii2-sendgrid": "*"

```

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

Usage
-----

[](#usage)

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

Usign API Key:

```
'components' => [
    ...
    'mailer' => [
        'class' => 'thiagotalma\sendgrid\Mailer',
        'key' => 'your api key',
        //'viewPath' => '@app/views/mail', // your view path here
    ],
    ...
],
```

Usign username and password:

```
'components' => [
    ...
    'mailer' => [
        'class' => 'thiagotalma\sendgrid\Mailer',
        'username' => 'your username',
        'password' => 'your password here',
        //'viewPath' => '@app/views/mail', // your view path here
    ],
    ...
],
```

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

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3592d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/612578?v=4)[Thiago Talma](/maintainers/thiagotalma)[@thiagotalma](https://github.com/thiagotalma)

---

Top Contributors

[![thiagotalma](https://avatars.githubusercontent.com/u/612578?v=4)](https://github.com/thiagotalma "thiagotalma (2 commits)")

---

Tags

apiemailsendgridyii2extensionsmtp

### Embed Badge

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

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

###  Alternatives

[sendgrid/smtpapi

Build SendGrid X-SMTPAPI headers in PHP.

686.6M2](/packages/sendgrid-smtpapi)[nterms/yii2-mailqueue

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

84133.5k2](/packages/nterms-yii2-mailqueue)[boundstate/yii2-mailgun

Mailgun integration for the Yii framework

28165.8k](/packages/boundstate-yii2-mailgun)[yarcode/yii2-mailgun-mailer

Mailgun mailer implementation for Yii2

1576.5k](/packages/yarcode-yii2-mailgun-mailer)[bryglen/yii2-sendgrid

Sendgrid Mailer for Yii 2

1253.7k](/packages/bryglen-yii2-sendgrid)[djagya/yii2-sparkpost

A library provides Yii2 integration with SparkPost mail service

1816.4k](/packages/djagya-yii2-sparkpost)

PHPackages © 2026

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