src/PHPDish/Bundle/UserBundle/Controller/ResettingController.php
public function onSendEmailInitialize(GetResponseNullableUserEvent $event)
    {
        $response = $this->redirectToRoute('fos_user_resetting_request');
        /** @var TranslatorInterface */
        $translator = $this->get('translator');
        if ($event->getUser() === null) {
            $this->addFlash('danger', $translator->trans('resetting.username_or_email_not_exists'));
            $event->setResponse($response);
        } elseif (!$event->getUser()->getEmail()) {
            $this->addFlash('warning', $translator->trans('resetting.user_missing_email'));
            $event->setResponse($response);
        }
    }
public function onSendEmailInitialize(GetResponseNullableUserEvent $event)
    {
        $response = $this->redirectToRoute('fos_user_resetting_request');
        /** @var TranslatorInterface */
        $translator = $this->get('translator');
        if ($event->getUser() === null) {
            $this->addFlash('danger', $translator->trans('resetting.username_or_email_not_exists'));
            $event->setResponse($response);
        } elseif (!$event->getUser()->getEmail()) {
            $this->addFlash('warning', $translator->trans('resetting.user_missing_email'));
            $event->setResponse($response);
        }
    }
发送邮件初始化
@param GetResponseNullableUserEvent $event