create a mail when an account is created by an administrator
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Events\UserCreated;
|
||||
use App\Mail\CreateUserByAdminMail;
|
||||
use App\Mail\TestMail;
|
||||
use App\Mail\ValidateMail;
|
||||
use App\Models\Notification;
|
||||
@@ -86,6 +87,13 @@ class UserController extends Controller
|
||||
"phone" => $phone->formatInternational(),
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'name' => $user->name,
|
||||
'lastname' => $user->lastname,
|
||||
];
|
||||
Mail::to($user->email)->send(new CreateUserByAdminMail($data));
|
||||
|
||||
|
||||
return response()->json([
|
||||
'message' => 'User created successfully',
|
||||
"password" => $password,
|
||||
|
||||
Reference in New Issue
Block a user