Download the PHP package kitbrennan90/laravel-sendgrid-webhooks without Composer
On this page you can find all versions of the php package kitbrennan90/laravel-sendgrid-webhooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kitbrennan90/laravel-sendgrid-webhooks
More information about kitbrennan90/laravel-sendgrid-webhooks
Files in kitbrennan90/laravel-sendgrid-webhooks
Package laravel-sendgrid-webhooks
Short Description Laravel package for receiving and storing event webhooks from Sendgrid
License MIT
Informations about the package laravel-sendgrid-webhooks
Laravel Sendgrid Webhooks
This package enables your Laravel application to receive event webhooks from Sendgrid, and will automatically store those webhooks in your database. The package also fires Laravel events so you can hook in to the webhooks and take your own actions.
Installation
Getting the package
The best way to install this package is with composer. Run this from your command line:
Run the migrations
This package will create a table called sendgrid_webhook_events
which will be used to store all the Sendgrid webhooks received.
Once you have included the package, this migration will run automatically with your normal migrations, so just call:
Copy the config file (optional)
This library works without any local configuration, however you may want to use the config file in order to tweak the logs you receive (eg. to receive logs when you receive duplicate events).
Call the command below to copy the package config files:
Tell Sendgrid to use your new event webhook URL
Head over to https://app.sendgrid.com/settings/mail_settings and click on the 'Event Notification' section.
Your HTTP Post URL is: https://yourwebsite.com/sendgrid/webhook
Using the library
Querying records
This library uses a standard Laravel Eloquent model, so you can therefore query it as you would any other model.
Interacting with a record
Accessing data included with all event types:
Some data is only included with specific events. You can find out what these attributes are here: https://sendgrid.com/docs/API_Reference/Event_Webhook/event.html#-Event-objects
We include this data under the payload array within a record. For example: