Skip to content

Commit 3f7528b

Browse files
committed
fix(ShareAPI): Send mails for mail shares by default
It looks like, the frontend it needs to provide the `sendMail` param for the backend to decide wether mails would be sent. Our UI does not have that at the moment so it should default to sending emails always for mail shares. Not exactly sure how this was handled earlier but this is a good starting point. Resolves : #48012 Signed-off-by: fenn-cs <[email protected]>
1 parent c0e0ee9 commit 3f7528b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

apps/files_sharing/lib/Controller/ShareAPIController.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,16 @@ public function createShare(
658658
$this->checkInheritedAttributes($share);
659659

660660
// Handle mail send
661-
if ($sendMail === 'true' || $sendMail === 'false') {
661+
if (is_null($sendMail)) {
662+
// Define a default behavior when sendMail is not provided
663+
if ($shareType === IShare::TYPE_EMAIL) {
664+
// For email shares, the default is to send the mail
665+
$share->setMailSend(true);
666+
} else {
667+
// For all other share types, the default is to not send the mail
668+
$share->setMailSend(false);
669+
}
670+
} else {
662671
$share->setMailSend($sendMail === 'true');
663672
}
664673

0 commit comments

Comments
 (0)