mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-02-17 20:41:00 +01:00
Added user confirmation mail to admin email
This commit is contained in:
parent
668f246179
commit
d8b8142707
@ -10,6 +10,7 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Mail;
|
||||||
|
|
||||||
class RegisteredUserController extends Controller
|
class RegisteredUserController extends Controller
|
||||||
{
|
{
|
||||||
@ -68,6 +69,18 @@ class RegisteredUserController extends Controller
|
|||||||
$user->block = $block;
|
$user->block = $block;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
|
|
||||||
|
$user = $request->name;
|
||||||
|
$email = $request->email;
|
||||||
|
|
||||||
|
try {
|
||||||
|
Mail::send('auth.user-confirmation', ['user' => $user, 'email' => $email], function ($message) use ($user) {
|
||||||
|
$message->to(env('ADMIN_EMAIL'))
|
||||||
|
->subject('New user registration');
|
||||||
|
});
|
||||||
|
} catch (\Exception $e) {}
|
||||||
|
|
||||||
|
|
||||||
event(new Registered($user));
|
event(new Registered($user));
|
||||||
|
|
||||||
return redirect(url('dashboard'));
|
return redirect(url('dashboard'));
|
||||||
|
8
resources/views/auth/user-confirmation.blade.php
Normal file
8
resources/views/auth/user-confirmation.blade.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<x-guest-layout>
|
||||||
|
<div class="mb-4 text-sm text-gray-600">
|
||||||
|
<h2>A new user has registered on {{ str_replace(['http://', 'https://'], '', url('')) }} and is awaiting verification</h2>
|
||||||
|
<p>The user <i>{{$user}}</i> with the email <i>{{$email}}</i> has registered a new account on {{ url('') }} and is awaiting confirmation by an admin. Click <a href="{{ url('admin/users/all') }}">here</a> to verify the user.</p>
|
||||||
|
</div>
|
||||||
|
<a href="{{ url('admin/users/all') }}"><button>Manage users</button></a>
|
||||||
|
<br><br>
|
||||||
|
</x-guest-layout>
|
Loading…
x
Reference in New Issue
Block a user