PHPackages                             jorisvaesen/cakephp-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. jorisvaesen/cakephp-sendgrid

ActiveCakephp-plugin[Mail &amp; Notifications](/categories/mail)

jorisvaesen/cakephp-sendgrid
============================

Sendgrid wrapper for CakePHP

0.3.3(6y ago)0331MITPHPPHP &gt;=7.0.0

Since Jun 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jorisvaesen/cakephp-sendgrid)[ Packagist](https://packagist.org/packages/jorisvaesen/cakephp-sendgrid)[ RSS](/packages/jorisvaesen-cakephp-sendgrid/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (4)Versions (7)Used By (0)

Sendgrid wrapper for CakePHP
============================

[](#sendgrid-wrapper-for-cakephp)

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require jorisvaesen/cakephp-sendgrid

```

Load the plugin in **config/bootstrap.php**:

```
Plugin::load('JorisVaesen/Sendgrid', ['bootstrap' => true]);

```

Configuration
-------------

[](#configuration)

### Method 1 (using ENV)

[](#method-1-using-env)

The plugin loads from dotenv the following:

```
SENDGRID_API_KEY="your_sendgrid_api_key"

```

### Method 2 (using app.php)

[](#method-2-using-appphp)

Set the sendgrid api key in app.php:

```
'Sendgrid' => [
    'apiKey' => 'your_sendgrid_api_key',
],

```

### Method 3 (hardcoded)

[](#method-3-hardcoded)

Add in your **app.php** file, in the **EmailTransport** item

```
'EmailTransport' => [
        ...
        'sendgrid' => [
            'className' => '\JorisVaesen\Sendgrid\Mailer\Transport\SendgridTransport',
            'password' => 'your_sendgrid_api_key',
        ],
        ...
    ],

```

To use it by default, set your default transport to `sendgrid` in **app.php**:

```
'Email' => [
    'default' => [
        'transport' => 'sendgrid',
    ],
],

```

### Callback

[](#callback)

If you want to use Sendgrid API methods which do not have a CakePHP equivalent, you can make use of the callback configuration:

```
'EmailTransport' => [
        ...
        'sendgrid' => [
            'className' => '\JorisVaesen\Sendgrid\Mailer\Transport\SendgridTransport',
            'password' => 'your_sendgrid_api_key',
            'callback' => function (\SendGrid\Mail\Mail $sendgridEmail, \Cake\Mailer\Email $cakephpEmail) {
                if ($cakephpEmail->getSubject() === 'If you open this mail...') {
                    $sendgridEmail->setOpenTracking(true);
                }

                return $sendgridEmail;
            },
        ],
        ...
    ],

```

Usage
-----

[](#usage)

```
$email = new Email('default');
$email->viewBuilder()->setLayout('default);
/* @var \Sendgrid\Response $response */
$response = $email
    ->setProfile('sendgrid')    // optional when you've set sendgrid as the default transport in configuration
    ->setEmailFormat('html')
    ->setSender('noreply@example.com', 'Example sender')
    ->setFrom('from@example.com', 'Example From')
    ->setReplyTo('replyTo@example.com', 'Example ReplyTo')
    ->setTo('to@example.com', 'Example To')
    ->setSubject('Sample email')
    ->setTemplate('default')
    ->setViewVars([])
    ->send();

return $response->statusCode() === 202;

```

[www.datrix.be](https://www.datrix.be)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~91 days

Recently: every ~114 days

Total

6

Last Release

2431d ago

PHP version history (2 changes)0.1.1PHP &gt;=5.4.16

0.3.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/935b8cd6be3a6ff53cae55eead3916bcfabec5de937f75221bb37cecd7d92374?d=identicon)[jorisvaesen](/maintainers/jorisvaesen)

---

Top Contributors

[![jorisvaesen](https://avatars.githubusercontent.com/u/4093781?v=4)](https://github.com/jorisvaesen "jorisvaesen (3 commits)")

---

Tags

cakephpsendgrid

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jorisvaesen-cakephp-sendgrid/health.svg)

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

###  Alternatives

[iandenh/cakephp-sendgrid

SendgridEmail plugin for CakePHP

16123.4k](/packages/iandenh-cakephp-sendgrid)[lorenzo/cakephp-email-queue

Queue, preview and and send emails stored in the database

57121.5k1](/packages/lorenzo-cakephp-email-queue)[narendravaghela/cakephp-mailgun

Mailgun plugin for CakePHP - Send emails using Mailgun API

23356.6k](/packages/narendravaghela-cakephp-mailgun)[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)
