Skip to content

Commit 236e084

Browse files
committed
fix(sharing): send share emails for internal users too
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 9c717aa commit 236e084

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

apps/files_sharing/lib/Controller/ShareAPIController.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,13 @@ public function createShare(
661661

662662
// Handle mail send
663663
if (is_null($sendMail)) {
664-
// Define a default behavior when sendMail is not provided
665-
// For email shares with a valid recipient, the default is to send the mail
666-
// For all other share types, the default is to not send the mail
667-
$allowSendMail = ($shareType === IShare::TYPE_EMAIL && $shareWith !== null && $shareWith !== '');
664+
$allowSendMail = $this->config->getSystemValueBool('sharing.enable_share_mail', true);
665+
if ($allowSendMail !== true || $shareType === IShare::TYPE_EMAIL) {
666+
// Define a default behavior when sendMail is not provided
667+
// For email shares with a valid recipient, the default is to send the mail
668+
// For all other share types, the default is to not send the mail
669+
$allowSendMail = ($shareType === IShare::TYPE_EMAIL && $shareWith !== null && $shareWith !== '');
670+
}
668671
$share->setMailSend($allowSendMail);
669672
} else {
670673
$share->setMailSend($sendMail === 'true');

0 commit comments

Comments
 (0)