php - Laravel 5 Sending email to owner after a user register -
i'm using default login , registration system of laravel. want whenever new user registered email sent 1 of email address input, sending email me notify me new user register.
how this?
you can overwrite register
method in authcontroller
.
put , send super simple email registered user:
public function register(request $request) { // original script, not touch $validator = $this->validator($request->all()); if ($validator->fails()) { $this->throwvalidationexception( $request, $validator ); } \auth::guard($this->getguard())->login($this->create($request->all())); // custom script \mail::raw('welcome ' . $request->input('name') . '!', function ($m) use ($request) { $m->to($request->input('email'))->subject('registration successful!'); }); return redirect($this->redirectpath()); }
to learn more mailing, should read official docs: https://laravel.com/docs/5.2/mail
Comments
Post a Comment