PHP code example of timfeid / laravel-sendgrid

1. Go to this page and download the library: Download timfeid/laravel-sendgrid library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

timfeid / laravel-sendgrid example snippets


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

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

    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 protected]');
        $mail->subject('Crazy subject');
    });