]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow to disable share emails 22297/head
authorJoas Schilling <coding@schilljs.com>
Wed, 19 Aug 2020 07:03:58 +0000 (09:03 +0200)
committerJoas Schilling <coding@schilljs.com>
Wed, 19 Aug 2020 07:03:58 +0000 (09:03 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
config/config.sample.php
lib/private/Share20/Manager.php

index a74c5ba577d5599589579d490087a50a38108592..61d7130660d205dcae31f2dd47a677b345db887d 100644 (file)
@@ -1410,6 +1410,11 @@ $CONFIG = [
  */
 '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
index 3b022f5951c13dfd7604cca0d0f6652ba7b5ffcd..e07cda518d546b7b6a47a9043628831d46fa932c 100644 (file)
@@ -805,7 +805,8 @@ class Manager implements IManager {
 
                $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();
                        if ($mailSend === true) {
                                $user = $this->userManager->get($share->getSharedWith());