Download the PHP package netglue/sendgrid-webhook without Composer

On this page you can find all versions of the php package netglue/sendgrid-webhook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sendgrid-webhook

ZF2 Module: Send Grid Events Webhook

A simple module for a ZF2 app that will receive event webhooks from SendGrid and trigger a ZF2 event for each of the batched events received. You can then write your own listeners to do whatever you need to do with bounce processing etc.

Install

Install with composer using "netglue/sendgrid-webhook", enable the module in your application.config.php using the module name 'NetglueSendgrid' and add custom configuration to change the route url perhaps or set up Basic HTTP Auth (Recommended).

Test

cd to wherever the module is installed, issue a composer install followed by a phpunit.

Setup Basic Auth

Create a configuration file in your autoload directory named something like sendgrid.local.php and enter values for username and password as outlined in ./config/module.config.php.

Set an Alternate Webhook Endpoint/URL

Somewhere in your configuration files where you like to look after your routes, add a new one with configuration similar to this:

'router' => [
    'routes' => [
        'sendgrid-webhook' => [
            'options' => [
                'route' => '/somewhere/this-is-your-endpoint',
            ]
        ]
    ]
]

Setup SendGrid

Navigate to your account at SendGrid and access the Settings -> Mail Settings section. Click the Event Notification item and enter the url. By default, the URL should be something like: https://yourdomain.com/netglue-sendgrid-events.

Effectively, nothing will happen, but you should start to see something in your web server logs. You'll need to write some listeners to do something with the events triggered.

Write A Listener

For example, in your main app's Module.php you could setup a listener to log the events with something like this:

public function onBoostrap(EventInterface $e)
{
    // Get a logger instance - change this…
    $services = $e->getApplication()->getServiceManager();
    $logger = $services->get('TheNameOfMyLogger');

    // Listen to all events sent by the EventEmitter
    $em = $e->getApplication()->getEventManager();
    $sharedEm = $em->getSharedManager();
    $sharedEm->attach(
        'NetglueSendgrid\Service\EventEmitter',
        '*',
        function($event) use ($logger) {
            $params = $event->getParams();
            $logger->debug(sprintf(
                'Send Grid Event "%s" was triggered with the event name %s',
                $params['data']['event'],
                $event->getName()
            ));
        }
    );
}

Changelog

1.0.0

Initial release


All versions of sendgrid-webhook with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package netglue/sendgrid-webhook contains the following files

Loading the files please wait ....