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 committed by backportbot[bot]
parent 8a8ce8eb7d
commit 15cbac0f32
2 changed files with 7 additions and 1 deletions

View 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

View 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());