I am facing a stranger issue which is recover password email is not working in Application but working with API client tools like: POSTMAN.
public function recover(Request $request)
{
$credentials = json_decode(request()->getContent(),true);
$user = User::where('email', $credentials['email'])->first();
if (!$user) { $error_message = "Your email address was not found.";
return response()->json(['success' => false, 'errors' => ['email'=> $error_message]], 401);
}
try { $sendMail = Password::sendResetLink($request->only('email'),
function (Message $message)
{ $message->subject('Your Password Reset Link'); });
return response()->json([ 'success' => true, 'data'=> ['message'=> 'A reset email has been sent! Please check your email.'] ]);
}
catch (\Exception $e) {
//Return with errors
$error_message = $e->getMessage();
return response()->json(['success' => false, 'errors' => [$error_message]], 401);
}
}
we have used AWS SMTP setting in .ENV file.
Any one can provide solution why is there issue? Let me know if any further information require
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire