PHPackages                             iyngaran/send-grid-transport - 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. iyngaran/send-grid-transport

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

iyngaran/send-grid-transport
============================

SendGrid Transport for Zend Framework 3 to send emails using SendGrid - https://sendgrid.com/.

1.0.0(7y ago)0201[1 PRs](https://github.com/iyngaran/SendGridTransport/pulls)MITPHPPHP &gt;=5.6

Since Oct 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/iyngaran/SendGridTransport)[ Packagist](https://packagist.org/packages/iyngaran/send-grid-transport)[ RSS](/packages/iyngaran-send-grid-transport/feed)WikiDiscussions dev-master Synced today

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

SendGrid Transport Module for Zend Framework
============================================

[](#sendgrid-transport-module-for-zend-framework)

[![Latest Stable Version](https://camo.githubusercontent.com/fd0a8c54def8881ca2d9d6099f7e6305cf18ce0bac40a5a38fc4f039eac82fc6/68747470733a2f2f706f7365722e707567782e6f72672f69796e676172616e2f73656e642d677269642d7472616e73706f72742f762f737461626c65)](https://packagist.org/packages/iyngaran/send-grid-transport)[![Total Downloads](https://camo.githubusercontent.com/7af5efc222b84a050aa6db3419d0e6b43b4350995bab788f8f8424928075c03b/68747470733a2f2f706f7365722e707567782e6f72672f69796e676172616e2f73656e642d677269642d7472616e73706f72742f646f776e6c6f616473)](https://packagist.org/packages/iyngaran/send-grid-transport)[![Latest Unstable Version](https://camo.githubusercontent.com/a64f2c97b51925f457714dba9606418851e4f5225053061470cfadc373b10281/68747470733a2f2f706f7365722e707567782e6f72672f69796e676172616e2f73656e642d677269642d7472616e73706f72742f762f756e737461626c65)](https://packagist.org/packages/iyngaran/send-grid-transport)[![License](https://camo.githubusercontent.com/0092539b17d2e1aaff92213d7ff1c0f0b2e71e20a9f89c50aa121712cc2cea53/68747470733a2f2f706f7365722e707567782e6f72672f69796e676172616e2f73656e642d677269642d7472616e73706f72742f6c6963656e7365)](https://packagist.org/packages/iyngaran/send-grid-transport)[![Codacy Badge](https://camo.githubusercontent.com/46525520007332a652eabde9833f850ce26d3fb8d59dc466d00561b4e8c75108/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6438383937633566353564653436393438346136373632643432383363633737)](https://www.codacy.com/app/iyngaran/SendGridTransport?utm_source=github.com&utm_medium=referral&utm_content=iyngaran/SendGridTransport&utm_campaign=Badge_Grade)

This module can be use as a transport to send transactional e-mail using SendGrid API in Zend Framework 2.

INSTALLING
----------

[](#installing)

`composer require iyngaran/send-grid-transport`

After install follow one of these steps:

1. Copy the contents file `vendor/iyngaran/send-grid-transport/mail.global.php.dist` and put it in your `config/autoload/mail.global.php`.
2. If this file does not exists in your application, just copy the entire file and place into your `config/autoload` removing the .dist extension.

Then add your SendGrid API Key. To get your API Key, [please visit](https://sendgrid.com/docs/Classroom/Send/How_Emails_Are_Sent/api_keys.html)

And also add the test email from-email address, name and to-email address, name.

```
// config/autoload/mail.global.php

return [
    'mail' => [
        'sendgrid' => [
            'api_key' => 'YOUR_API_KEY',
        ]
    ],
    'test-email' => [
        'from' => [
            'name' => 'Iyngaran Iyathurai',
            'email' => 'test@iyngaran.info'
        ],
        'to' => [
            'name' => 'Your name',
            'email' => 'your email address'
        ]
    ]
];
```

After all, you must register `SendGridTransport` module in your `config/modules.config.php`.

```
// config/modules.config.php
return [
    'Zend\ServiceManager\Di',
    ....
    'Application',
    'SendGridTransport'
];
```

TESTING
-------

[](#testing)

Go to this Url - /send-grid-email to send a test email.

USAGE
-----

[](#usage)

### Example in a controller

[](#example-in-a-controller)

```
namespace SendGridTransport\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use SendGridTransport\Mail\Transport\SendGridTransport;

class SendEmailController extends AbstractActionController
{
    private $sendGridTransport;
    private $config;

    public function __construct(SendGridTransport $sendGridTransport, array $config)
    {
        $this->sendGridTransport = $sendGridTransport;
        $this->config = $config;
    }

    public function indexAction()
    {
        $message = new \SendGridTransport\Mail\Message();
        $body = 'Hello :), The SendGridTransport is working now :)';
        $message->setBody($body);
        $message->setFrom(
            new \Zend\Mail\Address(
                $this->config['test-email']['from']['email'],
                $this->config['test-email']['from']['name']
            )
        );
        $message->addTo(
            new \Zend\Mail\Address(
                $this->config['test-email']['to']['email'],
                $this->config['test-email']['to']['name']
            )
        );
        $message->setSubject('Testing SendGridTransport - Iyngaran');
        $message->setBodyText('Hello, the SendGridTransport is working now :)');
        print('');
        print_r($this->sendGridTransport->send($message));
        print('');

        return [];
    }
}
```

> Is strongly recommended to use the already registered service.

CONTRIBUTING
------------

[](#contributing)

You can contribute with this module suggesting improvements, making tests and reporting bugs. Use [issues](https://github.com/iyngaran/send-grid-transport/issues) for that.

ERRORS
------

[](#errors)

Report errors opening [Issues](https://github.com/iyngaran/SendGridTransport/issues).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

2764d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/356a3abaef062d77ca1085716fef809cabdabf9b8908eb3e400712eb924cde1f?d=identicon)[iyngaran](/maintainers/iyngaran)

---

Top Contributors

[![iyngaran-parkwaylabs](https://avatars.githubusercontent.com/u/29912901?v=4)](https://github.com/iyngaran-parkwaylabs "iyngaran-parkwaylabs (8 commits)")

---

Tags

emailemail-sendersendgridsendgrid-apizendframeworkzf2zf3SendGrid module

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iyngaran-send-grid-transport/health.svg)

```
[![Health](https://phpackages.com/badges/iyngaran-send-grid-transport/health.svg)](https://phpackages.com/packages/iyngaran-send-grid-transport)
```

###  Alternatives

[mtymek/mt-mail

Zend Framework e-mail module. Using this library can easily create e-mail messages from PHTML templates (with optional layouts) and send them using configurable transports. Pluggable, EventManager-driven architecture allows you to customize every aspect of the process.

1839.2k3](/packages/mtymek-mt-mail)[davidhavl/dherrorlogging

Full featured error logging module for ZF2/ZF3 application

1924.5k](/packages/davidhavl-dherrorlogging)[goalio/goalio-mailservice

Provide configurable Mail Transport Factories for ZF2

1386.8k6](/packages/goalio-goalio-mailservice)[spoonx/sxmail

A simple mail module for Zend Framework 2.

1173.1k](/packages/spoonx-sxmail)[rwoverdijk/sxmail

A simple mail module for Zend Framework 2.

111.5k](/packages/rwoverdijk-sxmail)

PHPackages © 2026

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