PHP code example of stechstudio / laravel-email-events

1. Go to this page and download the library: Download stechstudio/laravel-email-events 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/ */

    

stechstudio / laravel-email-events example snippets


EmailEvents::routes();

namespace App\Listeners;

use STS\EmailEvents\EmailEvent;

class NotifyBouncedEmail {

    public function handle(EmailEvent $event)
    {
        // I only care about bounces
        if($event->getAction() != EmailEvent::EVENT_BOUNCED) {
            return;
        } 
        
        // Ok so we have an email bounce! Need to go handle that. Maybe notify us on Slack?
        // ...
    }
    
}