Looking to hire Laravel developers? Try LaraJobs

laravel-sendgrid maintained by timfeid

Description
Add sendgrid api methods to Laravel's Mail
Author
Last update
2018/04/17 20:59 (dev-master)
License
Links
Downloads
578

Comments
comments powered by Disqus

Laravel Sendgrid

Installation

config/app.php

    // Remove or comment out:
    // Illuminate\Mail\MailServiceProvider::class,
    // Add
    TimFeid\LaravelSendgrid\LaravelSendgridServiceProvider::class,

config/services.php

    'sendgrid' => [
        'api_key' => env('SENDGRID_API_KEY'),
    ],

.env

SENDGRID_API_KEY=[your_api_key]

Usage

    Mail::send('email.forgot-password', [], function ($mail) {
        // Added category functionality
        $mail->category('forgot-password');
        // Added custom arguments functionality
        $mail->uniqueArgs(['user_id' => 1]);

        // Default Laravel functionality
        $mail->to('email@address.com');
        $mail->subject('Crazy subject');
    });