Skip to content

Commit c20bfc1

Browse files
committed
Reset sent at timestamp is emails fail
1 parent b5ee5d4 commit c20bfc1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Helper/User/UserMailer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public function sendPasswordResetEmail(AbstractUser $user): bool
5050
if ($email) {
5151
$user->setPasswordRequestedAt(new \DateTime());
5252
$this->container->get('doctrine.orm.entity_manager')->flush();
53+
} else {
54+
$user->setPasswordRequestedAt(null);
5355
}
5456

5557
return $this->send($email);
@@ -62,6 +64,8 @@ public function sendChangeEmailConfirmationEmail(AbstractUser $user): bool
6264
if ($email) {
6365
$user->setNewEmailAddressChangeRequestedAt(new \DateTime());
6466
$this->container->get('doctrine.orm.entity_manager')->flush();
67+
} else {
68+
$user->setNewEmailAddressChangeRequestedAt(null);
6569
}
6670

6771
return $this->send($email);
@@ -74,6 +78,8 @@ public function sendEmailVerifyEmail(AbstractUser $user): bool
7478
if ($email) {
7579
$user->setEmailAddressVerificationRequestedAt(new \DateTime());
7680
$this->container->get('doctrine.orm.entity_manager')->flush();
81+
} else {
82+
$user->setEmailAddressVerificationRequestedAt(null);
7783
}
7884

7985
return $this->send($email);

0 commit comments

Comments
 (0)