Skip to content

Commit

Permalink
Merge pull request #48381 from nextcloud/fix/48012/fix-share-email-se…
Browse files Browse the repository at this point in the history
…nd-mail-share

fix(ShareAPI): Send mails for mail shares by default
  • Loading branch information
nfebe authored Oct 24, 2024
2 parents 4176708 + e2d2a17 commit bc6a3e8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,16 @@ public function createShare(
$this->checkInheritedAttributes($share);

// Handle mail send
if ($sendMail === 'true' || $sendMail === 'false') {
if (is_null($sendMail)) {
// Define a default behavior when sendMail is not provided
if ($shareType === IShare::TYPE_EMAIL && strlen($shareWith) !== 0) {
// For email shares, the default is to send the mail
$share->setMailSend(true);
} else {
// For all other share types, the default is to not send the mail
$share->setMailSend(false);
}
} else {
$share->setMailSend($sendMail === 'true');
}

Expand Down

0 comments on commit bc6a3e8

Please sign in to comment.