Merge branch 'dev/mailing/bugfix-3' into 'develop'
resend correct mail to existing user See merge request easy-solutions/apps/easyportal!12
This commit is contained in:
commit
7dc369ee67
|
|
@ -931,6 +931,10 @@ class UserController extends AbstractController
|
|||
$this->loggerService->logEntityNotFound('User', ['id' => $user->getId()], $actingUser->getId());
|
||||
throw $this->createNotFoundException(self::NOT_FOUND);
|
||||
}
|
||||
$token = $this->userService->generatePasswordToken($user, $org->getId());
|
||||
if ($user->getLastConnection() !== null) {
|
||||
$this->userService->sendExistingUserNotifications($user, $org, $actingUser);
|
||||
} else {
|
||||
$uo = $this->uoRepository->findOneBy(['users' => $user,
|
||||
'organization' => $org,
|
||||
'statut' => "INVITED"]);
|
||||
|
|
@ -943,7 +947,6 @@ class UserController extends AbstractController
|
|||
$uo->setModifiedAt(new \DateTimeImmutable());
|
||||
try {
|
||||
$data = ['user' => $uo->getUsers(), 'organization' => $uo->getOrganization()];
|
||||
$token = $this->userService->generatePasswordToken($user, $org->getId());
|
||||
$this->emailService->sendPasswordSetupEmail($user, $token);
|
||||
$this->loggerService->logEmailSent($userId, $org->getId(), 'Invitation Resent');
|
||||
$this->organizationsService->notifyOrganizationAdmins($data, 'USER_INVITED');
|
||||
|
|
@ -958,6 +961,7 @@ class UserController extends AbstractController
|
|||
return $this->json(['message' => 'Erreur lors de l\'envoie du mail.'], Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
throw $this->createAccessDeniedException(self::ACCESS_DENIED);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -660,7 +660,7 @@ class UserService
|
|||
}
|
||||
|
||||
// Private helpers for email notifications
|
||||
private function sendExistingUserNotifications(User $user, Organizations $org, User $actingUser): void
|
||||
public function sendExistingUserNotifications(User $user, Organizations $org, User $actingUser): void
|
||||
{
|
||||
try {
|
||||
$token = $this->generatePasswordToken($user, $org->getId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue