From fae5d92521f84cb6977c6ed1eaebf6c347f4c4d0 Mon Sep 17 00:00:00 2001 From: taiebot Date: Wed, 22 Jul 2026 21:40:06 +0200 Subject: [PATCH] Fix: Proposal generate notifications for confirmed meetings * Fix Generate notifications for confirmed meetings Added notification generation for confirmed meetings. Signed-off-by: taiebot * Update proposal confirmation logic and notifications Add confirmed date to proposal and adjust notification buttons Signed-off-by: taiebot * Update ProposalService.php Signed-off-by: taiebot * Clean up whitespace in ProposalService.php Removed unnecessary line breaks and whitespace in the proposal confirmation process. Signed-off-by: taiebot --------- Signed-off-by: taiebot --- lib/Service/Proposal/ProposalService.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/Service/Proposal/ProposalService.php b/lib/Service/Proposal/ProposalService.php index f4b49beb48..d222b16b4d 100644 --- a/lib/Service/Proposal/ProposalService.php +++ b/lib/Service/Proposal/ProposalService.php @@ -377,6 +377,12 @@ public function convertProposal(IUser $user, int $proposalId, int $dateId, array } $this->applyCalendarBlockersParticipant($user, $proposal, 'M', $vObject); + // keep only the confirmed date so the notification email shows just that one + $confirmedDate = new ProposalDateCollection(); + $confirmedDate[] = $selectedDate; + $proposal->setDates($confirmedDate); + // generate notifications for internal and external participants that the meeting is confirmed + $this->generateNotifications($user, $proposal, 'F'); // destroy the proposal entry $this->proposalVoteMapper->deleteByProposalId($user->getUID(), $proposal->getId()); $this->proposalParticipantMapper->deleteByProposalId($user->getUID(), $proposal->getId()); @@ -496,6 +502,9 @@ private function sendEmailNotifications(IUser $user, ProposalObject $proposal, P ), 'D' => $template->setSubject( $this->l10n->t('%s has canceled a proposed meeting', [$senderName]) + ), + 'F' => $template->setSubject( + $this->l10n->t('%s has confirmed a meeting date', [$senderName]) ) }; // heading @@ -508,13 +517,18 @@ private function sendEmailNotifications(IUser $user, ProposalObject $proposal, P ), 'D' => $template->addHeading( $this->l10n->t('Dear %s, a proposed meeting has been cancelled', [$recipientName]) + ), + 'F' => $template->addHeading( + $this->l10n->t('Dear %s, a meeting date has been confirmed', [$recipientName]) ) }; // buttons - $template->addBodyButton( - $this->l10n->t('Respond'), - $this->urlGenerator->linkToRouteAbsolute('Calendar.ProposalPublic.index', ['token' => $recipientToken]) - ); + if ($reason !== 'F') { + $template->addBodyButton( + $this->l10n->t('Respond'), + $this->urlGenerator->linkToRouteAbsolute('Calendar.ProposalPublic.index', ['token' => $recipientToken]) + ); + } // description if (!empty($proposal->getDescription())) { $template->addBodyListItem($proposal->getDescription(), $this->l10n->t('Description:'));