Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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