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 @@ -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 ' );
You can’t perform that action at this time.
0 commit comments