Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-08-19 10:03:58 +0300
committerJoas Schilling <coding@schilljs.com>2020-08-19 10:03:58 +0300
commitc8f175e936ac33d81bcc9353845b69047da1c00f (patch)
treecb97f3ce7e7deac55afed4c7bf03247416b1bd1b
parent746e3f174fcd45ff5b6234263dc6371f9573a237 (diff)
Allow to disable share emails
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--config/config.sample.php5
-rw-r--r--lib/private/Share20/Manager.php3
2 files changed, 7 insertions, 1 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index a74c5ba577d..61d7130660d 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -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
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 3b022f5951c..e07cda518d5 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -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());