diff --git a/lib/Service/AttachmentService.php b/lib/Service/AttachmentService.php index c5f45e610e8..51f5acca1f1 100644 --- a/lib/Service/AttachmentService.php +++ b/lib/Service/AttachmentService.php @@ -504,7 +504,7 @@ private function getTextFilePublic(?int $documentId, string $shareToken): File { // is the file shared with this token? try { $share = $this->shareManager->getShareByToken($shareToken); - if ($share->getShareType() === IShare::TYPE_LINK) { + if (in_array($share->getShareType(), [IShare::TYPE_LINK, IShare::TYPE_EMAIL])) { // shared file or folder? if ($share->getNodeType() === 'file') { $textFile = $share->getNode();