File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
apps/files_sharing/lib/Controller Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -663,10 +663,13 @@ public function createShare(
663663
664664 // Handle mail send
665665 if (is_null ($ sendMail )) {
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 !== '' );
666+ $ allowSendMail = $ this ->config ->getSystemValueBool ('sharing.enable_share_mail ' , true );
667+ if ($ allowSendMail !== true || $ shareType === IShare::TYPE_EMAIL ) {
668+ // Define a default behavior when sendMail is not provided
669+ // For email shares with a valid recipient, the default is to send the mail
670+ // For all other share types, the default is to not send the mail
671+ $ allowSendMail = ($ shareType === IShare::TYPE_EMAIL && $ shareWith !== null && $ shareWith !== '' );
672+ }
670673 $ share ->setMailSend ($ allowSendMail );
671674 } else {
672675 $ share ->setMailSend ($ sendMail === 'true ' );
You can’t perform that action at this time.
0 commit comments