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

index 2c4bb90d232db05d5b4b60280eb008ccbad884c1..f90c4ede6d836b32d4ff06b4ac5cd41c32179d06 100644 (file)
@@ -1349,6 +1349,11 @@ $CONFIG = array(
  */
 '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 c8ba04a46361226071659a2492a574eba9a2c726..348e0207d2f2e432e6a10d27e436d01eca0173f3 100644 (file)
@@ -809,7 +809,8 @@ class Manager implements IManager {
 
                $this->dispatcher->dispatchTyped(new Share\Events\ShareCreatedEvent($share));
 
-               if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
+               if ($this->config->getSystemValueBool('sharing.enable_share_mail', true)
+                       && $share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
                        $mailSend = $share->getMailSend();
                        if($mailSend === true) {
                                $user = $this->userManager->get($share->getSharedWith());