From 36896c11d6d09ea0a0f698be27bde3951ece7457 Mon Sep 17 00:00:00 2001 From: Stefan Meyer Date: Mon, 12 Aug 2024 09:21:30 +0200 Subject: [PATCH] Merge pull request #7919 from mjansenDatabay/hotfix/8/cal-noti-unique-mail-attachments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calendar/Mail: Use (more or less) unique filenames for "ics" mail att… --- .../classes/class.ilCalendarMailNotification.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/ILIAS/Calendar/classes/class.ilCalendarMailNotification.php b/components/ILIAS/Calendar/classes/class.ilCalendarMailNotification.php index add740271f6f..59ec724b8caa 100755 --- a/components/ILIAS/Calendar/classes/class.ilCalendarMailNotification.php +++ b/components/ILIAS/Calendar/classes/class.ilCalendarMailNotification.php @@ -381,17 +381,15 @@ protected function addAttachment(): void $export->setAppointments([(int) $this->getAppointmentId()]); $export->export(); + $ics_filename = 'appointment_' . (new DateTimeImmutable('now'))->format('Ymd_His_u') . '.ics'; + $attachment = new ilFileDataMail($this->getSender()); - $attachment->storeAsAttachment( - 'appointment.ics', + $effective_ics_filename = $attachment->storeAsAttachment( + $ics_filename, $export->getExportString() ); - $this->setAttachments( - array( - 'appointment.ics' - ) - ); + $this->setAttachments([$effective_ics_filename]); } protected function deleteAttachments(): void