Skip to content

Commit

Permalink
Merge pull request #7919 from mjansenDatabay/hotfix/8/cal-noti-unique…
Browse files Browse the repository at this point in the history
…-mail-attachments

Calendar/Mail: Use (more or less) unique filenames for "ics" mail att…
  • Loading branch information
smeyer-ilias committed Aug 12, 2024
1 parent 5ce3c32 commit 36896c1
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 36896c1

Please sign in to comment.