mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
Merge pull request #49898 from nextcloud/fix/noid/no-emails-for-user-shares
fix(sharing): send share emails for internal users too
This commit is contained in:
commit
d9a7124592
1 changed files with 7 additions and 4 deletions
|
|
@ -663,10 +663,13 @@ class ShareAPIController extends OCSController {
|
|||
|
||||
// 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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue