PHPackages                             swiftmade/laravel-sendgrid-notification-channel - 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. swiftmade/laravel-sendgrid-notification-channel

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

swiftmade/laravel-sendgrid-notification-channel
===============================================

Laravel Notification Channel for Sengrid.com

v2.10.0(1mo ago)26287.7k—7.3%8MITPHPPHP &gt;=7.2CI passing

Since Aug 19Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/swiftmade/laravel-sendgrid-notification-channel)[ Packagist](https://packagist.org/packages/swiftmade/laravel-sendgrid-notification-channel)[ Docs](https://github.com/swiftmade/laravel-sendgrid-notification-channel)[ GitHub Sponsors](https://github.com/swiftmade)[ RSS](/packages/swiftmade-laravel-sendgrid-notification-channel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (18)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/af824eeb5d1427128b16e490be841f57db022988b5b50f011d8014504a577d38/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73776966746d6164652f6c61726176656c2d73656e64677269642d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swiftmade/laravel-sendgrid-notification-channel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/dbe772f9ec57bff9c4916f168071df35081a1b0f3ac470b10199459756ccf070/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73776966746d6164652f6c61726176656c2d73656e64677269642d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swiftmade/laravel-sendgrid-notification-channel)

Allows you to send Laravel notifications using Sendgrid's [Dynamic Transactional Templates](https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates) feature.

- Minimum Laravel version required: 7.x
- Minimum PHP version required: 7.2

(For older versions of Laravel, install v1)

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

To get started, you need to require this package:

```
composer require swiftmade/laravel-sendgrid-notification-channel
```

The service provider will be auto-detected by Laravel. If you've turned auto-discovery off, add the following service provider in your `config/app.php`.

```
NotificationChannels\SendGrid\SendGridServiceProvider::class,

```

Next, make sure you have a valid Sendgrid API key in `config/services.php`. You may copy the example configuration below to get started:

```
return [

    // other services...

    // add this...
    'sendgrid' => [
        'api_key' => env('SENDGRID_API_KEY'),
    ],
];
```

Usage
-----

[](#usage)

To send an email using dynamic templates, you need to:

1. Return `SendGridChannel::class` in the `via()` method. (Not `mail`)
2. Add and implement the `toSendGrid($notifiable){ }` method.

Example:

```
