mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Mail user registration confirmation.
This commit is contained in:
@@ -4,6 +4,9 @@ use FireflyIII\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\Registrar;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||
use Illuminate\Http\Request;
|
||||
use Mail;
|
||||
use Session;
|
||||
|
||||
/**
|
||||
* Class AuthController
|
||||
@@ -43,4 +46,40 @@ class AuthController extends Controller
|
||||
$this->middleware('guest', ['except' => 'getLogout']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a registration request for the application.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function postRegister(Request $request)
|
||||
{
|
||||
$validator = $this->registrar->validator($request->all());
|
||||
|
||||
if ($validator->fails()) {
|
||||
$this->throwValidationException(
|
||||
$request, $validator
|
||||
);
|
||||
}
|
||||
|
||||
$this->auth->login($this->registrar->create($request->all()));
|
||||
|
||||
// get the email address
|
||||
$email = $this->auth->user()->email;
|
||||
|
||||
// send email.
|
||||
Mail::send(
|
||||
'emails.registered', [], function ($message) use ($email) {
|
||||
$message->to($email, $email)->subject('Welcome to Firefly III!');
|
||||
}
|
||||
);
|
||||
|
||||
// set flash message
|
||||
Session::flash('success','You have registered successfully!');
|
||||
|
||||
|
||||
return redirect($this->redirectPath());
|
||||
}
|
||||
|
||||
}
|
||||
|
5
resources/views/emails/registered.blade.php
Normal file
5
resources/views/emails/registered.blade.php
Normal file
@@ -0,0 +1,5 @@
|
||||
Hey there!
|
||||
|
||||
Welkome to Firefly III. Your registration has made it, and this email is here to confirm it.
|
||||
|
||||
Thanks for using Firefly!
|
Reference in New Issue
Block a user