Skip to content

Commit

Permalink
fix(sharing): send share emails for internal users too
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Larch <[email protected]>
  • Loading branch information
miaulalala committed Dec 17, 2024
1 parent cba556d commit e17b91c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,13 @@ public function createShare(

// Handle mail send
if (is_null($sendMail)) {
// Define a default behavior when sendMail is not provided
// For email shares with a valid recipient, the default is to send the mail
// For all other share types, the default is to not send the mail
$allowSendMail = ($shareType === IShare::TYPE_EMAIL && $shareWith !== null && $shareWith !== '');
$allowSendMail = $this->config->getSystemValueBool('sharing.enable_share_mail', true);
if ($allowSendMail !== true || $shareType === IShare::TYPE_EMAIL) {
// Define a default behavior when sendMail is not provided
// For email shares with a valid recipient, the default is to send the mail
// For all other share types, the default is to not send the mail
$allowSendMail = ($shareType === IShare::TYPE_EMAIL && $shareWith !== null && $shareWith !== '');
}
$share->setMailSend($allowSendMail);
} else {
$share->setMailSend($sendMail === 'true');
Expand Down

0 comments on commit e17b91c

Please sign in to comment.