Skip to content

Commit

Permalink
Merge pull request #22297 from nextcloud/feature/15929/allow-to-disab…
Browse files Browse the repository at this point in the history
…le-share-emails

Allow to disable share emails
  • Loading branch information
nickvergessen authored Aug 19, 2020
2 parents 746e3f1 + c8f175e commit 4ff492a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,11 @@
*/
'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
Expand Down
3 changes: 2 additions & 1 deletion lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,8 @@ public function createShare(IShare $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();
if ($mailSend === true) {
$user = $this->userManager->get($share->getSharedWith());
Expand Down

0 comments on commit 4ff492a

Please sign in to comment.