Skip to content

Commit e46f180

Browse files
Merge pull request #48881 from nextcloud/backport/48381/stable30
2 parents 935a545 + 0f2013d commit e46f180

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

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 && strlen($shareWith) !== 0) {
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)