Allow to disable share emails

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-08-19 09:03:58 +02:00
parent 746e3f174f
commit c8f175e936
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with 7 additions and 1 deletions

View File

@ -1410,6 +1410,11 @@ $CONFIG = [
*/ */
'sharing.force_share_accept' => false, 'sharing.force_share_accept' => false,
/**
* Set to false to stop sending a mail when users receive a share
*/
'sharing.enable_share_mail' => true,
/** /**
* All other configuration options * All other configuration options

View File

@ -805,7 +805,8 @@ class Manager implements IManager {
$this->dispatcher->dispatchTyped(new Share\Events\ShareCreatedEvent($share)); $this->dispatcher->dispatchTyped(new Share\Events\ShareCreatedEvent($share));
if ($share->getShareType() === IShare::TYPE_USER) { if ($this->config->getSystemValueBool('sharing.enable_share_mail', true)
&& $share->getShareType() === IShare::TYPE_USER) {
$mailSend = $share->getMailSend(); $mailSend = $share->getMailSend();
if ($mailSend === true) { if ($mailSend === true) {
$user = $this->userManager->get($share->getSharedWith()); $user = $this->userManager->get($share->getSharedWith());