Skip to content

Instantly share code, notes, and snippets.

@ScullWM
Created May 29, 2015 11:22
Show Gist options
  • Save ScullWM/8acea9c0e229ed76717f to your computer and use it in GitHub Desktop.
Save ScullWM/8acea9c0e229ed76717f to your computer and use it in GitHub Desktop.
Easy Exemple
<?php
namespace Swm\Bundle\ForumBundle\Listener;
use JMS\DiExtraBundle\Annotation as DI;
use Swm\Bundle\MailHookBundle\Event\HookEventInterface;
/**
* @DI\Service()
*/
class BounceListener
{
private $userManager;
/**
* @DI\InjectParams({
* "userManager" = @DI\Inject("fos_user.user_manager")
* })
*/
public function __construct($userManager)
{
$this->userManager = $userManager;
}
/**
* @DI\Observe(Swm\Bundle\MailHookBundle\SwmMailHookEvent::MAILHOOK_HARDBOUNCE)
*/
public function hardBounce(HookEventInterface $hookEvent)
{
$user = $hookEvent->getUser();
$this->userManager->doThings($user);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment