File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,13 @@ public function sendEmailAction(Request $request)
117117 $ event = new GetResponseUserEvent ($ user , $ request );
118118 $ this ->eventDispatcher ->dispatch (FOSUserEvents::RESETTING_SEND_EMAIL_COMPLETED , $ event );
119119
120+ if (null !== $ event ->getResponse ()) {
121+ return $ event ->getResponse ();
122+ }
123+ } else {
124+ $ event = new GetResponseNullableUserEvent ($ user , $ request );
125+ $ this ->eventDispatcher ->dispatch (FOSUserEvents::RESETTING_SEND_EMAIL_FAILURE , $ event );
126+
120127 if (null !== $ event ->getResponse ()) {
121128 return $ event ->getResponse ();
122129 }
Original file line number Diff line number Diff line change @@ -258,13 +258,24 @@ final class FOSUserEvents
258258 /**
259259 * The RESETTING_SEND_EMAIL_COMPLETED event occurs after the email is sent.
260260 *
261- * This event allows you to set the response to bypass the the redirection after the email is sent.
261+ * This event allows you to set the response to bypass the redirection after the email is sent.
262262 * The event listener method receives a FOS\UserBundle\Event\GetResponseUserEvent instance.
263263 *
264264 * @Event("FOS\UserBundle\Event\GetResponseUserEvent")
265265 */
266266 const RESETTING_SEND_EMAIL_COMPLETED = 'fos_user.resetting.send_email.completed ' ;
267267
268+ /**
269+ * The RESETTING_SEND_EMAIL_FAILURE event occurs whenever email is not send due to non-existing username
270+ * or expired password request.
271+ *
272+ * This event allows you to set the response to bypass the redirection after the email is not sent.
273+ * The event listener method receives a FOS\UserBundle\Event\GetResponseNullableUserEvent instance.
274+ *
275+ * @Event("FOS\UserBundle\Event\GetResponseNullableUserEvent")
276+ */
277+ const RESETTING_SEND_EMAIL_FAILURE = 'fos_user.resetting.send_email.failure ' ;
278+
268279 /**
269280 * The USER_CREATED event occurs when the user is created with UserManipulator.
270281 *
You can’t perform that action at this time.
0 commit comments