/** * Confirm a user's registration * * @param string $token * @return mixed */ public function confirmRegistration($token, AppMailer $mailer) { $user = $this->users->confirmUser($token); if (!empty($user)) { $person = new Person(); $person->setNode($user); // Send an email to the user that his email has been confirmed $mailer->sendRegistrationConfirmation($person); } return redirect('/persons'); }
public function update($userId, UpdateUserRequest $request, AppMailer $mailer) { // Get the user $userNode = $this->users->getById($userId); if (!empty($userNode)) { $person = new Person(); $person->setNode($userNode); $person->update($request->input()); if ($request->input('verified', false)) { // Send an email to the user that his email has been confirmed $mailer->sendRegistrationConfirmation($person); } return response()->json(['message' => 'De gebruiker werd bijgewerkt.']); } abort(404); }