aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2025-02-06 10:34:54 +0100
committerGitHub <noreply@github.com>2025-02-06 10:34:54 +0100
commit5839a58737d113814161f7ec49792a0cf0bd0ed7 (patch)
tree9e1adbcf3a92c9d10d6f9254fecded95201fcefd
parent0e6f3ba02b8f0e8247b904c695f3158b1da87bb9 (diff)
parent6af3bec748cf0a9f8b3ef994d04e723f61b6bf91 (diff)
downloadnextcloud-server-5839a58737d113814161f7ec49792a0cf0bd0ed7.tar.gz
nextcloud-server-5839a58737d113814161f7ec49792a0cf0bd0ed7.zip
Merge pull request #50217 from nextcloud/backport/49898/stable30
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 17378d7ce21..dc9aa2d998b 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -652,10 +652,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');