Skip to content

Instantly share code, notes, and snippets.

@ojhaujjwal
Last active October 16, 2017 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojhaujjwal/196f2ad32da104debac4979d5a2a6253 to your computer and use it in GitHub Desktop.
Save ojhaujjwal/196f2ad32da104debac4979d5a2a6253 to your computer and use it in GitHub Desktop.
<?php
use App\Message\SendForgotPassword;
use App\Message\SendImportantEmail;
$router = new SimpleRouter();
$router->add('SendForgotPasswordEmail', function(SendForgotPassword $message) {
// $mailer = ....
// $mailer->sendMail($message->getUser()->getEmail(), 'subject', 'contents');
});
$router->add('SendImportantEmail', function(SendImportantEmail $message) {
// Send important here
});
// Create a Consumer and start the loop.
$consumer = new Consumer($router, $eventDispatcher);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment