File tree Expand file tree Collapse file tree
apps/files_sharing/lib/Controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -652,10 +652,13 @@ public function createShare(
652652
653653 // Handle mail send
654654 if (is_null ($ sendMail )) {
655- // Define a default behavior when sendMail is not provided
656- // For email shares with a valid recipient, the default is to send the mail
657- // For all other share types, the default is to not send the mail
658- $ allowSendMail = ($ shareType === IShare::TYPE_EMAIL && $ shareWith !== null && $ shareWith !== '' );
655+ $ allowSendMail = $ this ->config ->getSystemValueBool ('sharing.enable_share_mail ' , true );
656+ if ($ allowSendMail !== true || $ shareType === IShare::TYPE_EMAIL ) {
657+ // Define a default behavior when sendMail is not provided
658+ // For email shares with a valid recipient, the default is to send the mail
659+ // For all other share types, the default is to not send the mail
660+ $ allowSendMail = ($ shareType === IShare::TYPE_EMAIL && $ shareWith !== null && $ shareWith !== '' );
661+ }
659662 $ share ->setMailSend ($ allowSendMail );
660663 } else {
661664 $ share ->setMailSend ($ sendMail === 'true ' );
You can’t perform that action at this time.
0 commit comments