feat: re-generate access links for bookings when sent via email
This commit is contained in:
@@ -492,13 +492,15 @@ class AccommodationBookingService
|
||||
}
|
||||
|
||||
/**
|
||||
* Explicit admin action: (re)issues the access link, invalidating any previously issued
|
||||
* link for this booking. No email side effect — sending is a separate, explicit admin
|
||||
* action via sendCustomerConfirmationEmail().
|
||||
* Explicit admin action: mails the access link again, refreshing its validity first so the
|
||||
* customer always receives a link that is good for another full TTL — the mail is the only
|
||||
* way a link reaches the customer, so sending and issuing belong together.
|
||||
* The previously issued link stops working, which is the point: one booking has one valid
|
||||
* link at a time.
|
||||
* A no-op for a record that is not customer accessible yet, for the same reason as
|
||||
* issueAccessLink().
|
||||
*/
|
||||
public function regenerateAccessLink(AccommodationBooking $booking): void
|
||||
public function sendAccessLink(AccommodationBooking $booking): void
|
||||
{
|
||||
if (!$booking->isCustomerAccessible()) {
|
||||
return;
|
||||
@@ -506,6 +508,8 @@ class AccommodationBookingService
|
||||
|
||||
$booking->setAccessLinkIssuedAt(new \DateTimeImmutable());
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->sendCustomerConfirmationEmail($booking);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user