File tree 2 files changed +19
-1
lines changed
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)
117
117
$ event = new GetResponseUserEvent ($ user , $ request );
118
118
$ this ->eventDispatcher ->dispatch (FOSUserEvents::RESETTING_SEND_EMAIL_COMPLETED , $ event );
119
119
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
+
120
127
if (null !== $ event ->getResponse ()) {
121
128
return $ event ->getResponse ();
122
129
}
Original file line number Diff line number Diff line change @@ -258,13 +258,24 @@ final class FOSUserEvents
258
258
/**
259
259
* The RESETTING_SEND_EMAIL_COMPLETED event occurs after the email is sent.
260
260
*
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.
262
262
* The event listener method receives a FOS\UserBundle\Event\GetResponseUserEvent instance.
263
263
*
264
264
* @Event("FOS\UserBundle\Event\GetResponseUserEvent")
265
265
*/
266
266
const RESETTING_SEND_EMAIL_COMPLETED = 'fos_user.resetting.send_email.completed ' ;
267
267
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
+
268
279
/**
269
280
* The USER_CREATED event occurs when the user is created with UserManipulator.
270
281
*
You can’t perform that action at this time.
0 commit comments