mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
chore: simplify docker-compose
This commit is contained in:
@@ -75,6 +75,25 @@ class RegistrationController extends AbstractController
|
||||
)
|
||||
);
|
||||
|
||||
if (false === (bool) $this->getParameter('registration_verify_email')) {
|
||||
$user->setVerified(true);
|
||||
} else {
|
||||
$email = $this->emailVerifier->sendEmailConfirmation('app_verify_email', $user,
|
||||
(new TemplatedEmail())
|
||||
->from(new Address($this->mailerSenderEmail, $this->mailerSenderName))
|
||||
->to($user->getEmail())
|
||||
->locale('en')
|
||||
->subject('Please Confirm your Email')
|
||||
->htmlTemplate('emails/success/confirmation_email.html.twig')
|
||||
);
|
||||
|
||||
$signedUrl = (string) $email->getContext()['signedUrl'];
|
||||
$this->logger->notice('The validation link for user {username} is {signedUrl}', [
|
||||
'username' => $user->getUserIdentifier(),
|
||||
'signedUrl' => $signedUrl,
|
||||
]);
|
||||
}
|
||||
|
||||
$this->em->persist($user);
|
||||
$this->em->flush();
|
||||
|
||||
@@ -82,21 +101,6 @@ class RegistrationController extends AbstractController
|
||||
'username' => $user->getUserIdentifier(),
|
||||
]);
|
||||
|
||||
$email = $this->emailVerifier->sendEmailConfirmation('app_verify_email', $user,
|
||||
(new TemplatedEmail())
|
||||
->from(new Address($this->mailerSenderEmail, $this->mailerSenderName))
|
||||
->to($user->getEmail())
|
||||
->locale('en')
|
||||
->subject('Please Confirm your Email')
|
||||
->htmlTemplate('emails/success/confirmation_email.html.twig')
|
||||
);
|
||||
|
||||
$signedUrl = (string) $email->getContext()['signedUrl'];
|
||||
$this->logger->notice('The validation link for user {username} is {signedUrl}', [
|
||||
'username' => $user->getUserIdentifier(),
|
||||
'signedUrl' => $signedUrl,
|
||||
]);
|
||||
|
||||
return new Response(null, 201);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user