sneha #108

Merged
Sneha.Yadav merged 2 commits from sneha into main 2025-04-30 09:35:29 +00:00
2 changed files with 9 additions and 8 deletions

View File

@@ -295,13 +295,14 @@ class UsersController extends Controller
$activationLink = url("/apia/activate/{$userId}?token={$randomToken}");
// Send activation email
Mail::to($user->email)->queue(new UserCreatedMail($user, $activationLink));
Mail::to($user->email)->send(new UserCreatedMail($user, $activationLink));
return response()->json([
'success' => true,
'message' => 'User created successfully',
'data' => [
'user_id' => $userId,
'token'=>$randomToken,
'activation_link' => $activationLink,
'external_service_response' => $serviceResponse
]
@@ -661,7 +662,6 @@ class UsersController extends Controller
$localResponse = null;
$thingsboardResponse = null;
// ✅ Check in Local database
$user = User::where('email', $email)->first();
if ($user) {
@@ -688,6 +688,9 @@ class UsersController extends Controller
], 200);
}
public function userlistCustomer(Request $request)
{
try {
@@ -752,4 +755,4 @@ class UsersController extends Controller
return jsonResponseWithErrorMessage($e->getMessage(), 500);
}
}
}
}

View File

@@ -233,15 +233,13 @@ class AdminService
if (!isset($data['tenant_id'])) {
throw new \Exception('tenant_id is required');
}
// static $counter = 1;
// $email = "dummy{$counter}@example.com";
// $counter++;
$randomNumber = rand(1000, 9999);
$email = "dummy{$randomNumber}@example.com";
// Prepare the payload with required fields
$payload = [
'email' => $data['email'] ?? '',
'email' => $email?? '',
'authority' => $data['authority'] ?? 'CUSTOMER_USER',
'firstName' => $data['first_name'] ?? '',
'lastName' => $data['last_name'] ?? '',