The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

Laravel Sendgrid Driver

s-ichikawa/laravel-sendgrid-driver image

Laravel Sendgrid Driver stats

Downloads
5.2M
Stars
367
Open Issues
8
Forks
89

View on GitHub →

This library adds a 'sendgrid' mail driver to Laravel.

Laravel SendGrid Driver Package Summary

The Laravel SendGrid Driver is a robust package designed to integrate SendGrid's Web API with Laravel's mailing capabilities. This package extends Laravel's native mail functionality, allowing developers to leverage SendGrid for email delivery without deviating from Laravel's standard mailing practices.

Main Features:

  • Seamless Integration: Works with Laravel’s native mail functions.
  • Support for SendGrid API: Utilizes SendGrid for sending emails, including advanced features like categories and scheduling.
  • Template Support: Allows the use of SendGrid’s dynamic templates.
  • Custom Endpoints: Ability to set custom endpoints for API requests, useful for routing through proxies or other specific needs.

Installation and Configuration:

For Laravel:

  1. Installation via Composer:

    composer require s-ichikawa/laravel-sendgrid-driver

    For Laravel 5.5 and above, service providers are auto-discovered.

  2. Configuration:

    • Set the mail driver in .env:
      MAIL_DRIVER=sendgrid
      SENDGRID_API_KEY='YOUR_SENDGRID_API_KEY'
    • Update config/services.php:
      'sendgrid' => [
      'api_key' => env('SENDGRID_API_KEY'),
      ],

For Lumen:

  1. Installation via Composer:

    composer require "s-ichikawa/laravel-sendgrid-driver:^4.0"
  2. Configuration:

    • Register the service provider in bootstrap/app.php.
    • Configure mail and service details in respective config files.

Usage:

  • Basic Usage: Similar to Laravel's typical mail sending functions but with additional settings for SendGrid specific features such as categories.
  • Using Templates: For using SendGrid templates, specify the template ID and optionally use an empty array in the view method if you don’t need to pass data to a Laravel view.

Endpoint Configuration:

Customize the endpoint in config/services.php if you need to route requests through a custom URL or proxy:

'sendgrid' => [
'api_key' => env('SENDGRID_API_KEY'),
'endpoint' => 'https://custom.example.com/send',
],

This package is ideal for developers looking to integrate SendGrid's powerful email delivery services seamlessly into Laravel applications, providing both simplicity and flexibility in managing email communications.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


S Ichikawa Laravel Sendgrid Driver Related Articles

Concurrency Control in Laravel 12.36, Inertia View Transitions image

Concurrency Control in Laravel 12.36, Inertia View Transitions

Read article
Laravel's Enhanced Fluent Objects: Direct Iteration Support image

Laravel's Enhanced Fluent Objects: Direct Iteration Support

Read article
Simple Cookie Consent Package for Laravel image

Simple Cookie Consent Package for Laravel

Read article
Generating Sequential Laravel Collections image

Generating Sequential Laravel Collections

Read article
Customizing Model Date Formats in Laravel image

Customizing Model Date Formats in Laravel

Read article
Customizing Data Transformations with Laravel Casts image

Customizing Data Transformations with Laravel Casts

Read article
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media