diff --git a/lib/Service/SendMailService.php b/lib/Service/SendMailService.php index 592aa3b83..691f29f2d 100644 --- a/lib/Service/SendMailService.php +++ b/lib/Service/SendMailService.php @@ -22,6 +22,7 @@ use OCP\Mail\IEMailTemplate; use OCP\Mail\IMailer; use OCP\Security\IHasher; +use OCP\Share\IManager; use OCP\Util; class SendMailService { @@ -59,6 +60,7 @@ public function __construct( IMailer $mailer, Defaults $defaults, ConfigService $configService, + private IManager $shareManager, ) { $this->l10n = $l10n; $this->hasher = $hasher; @@ -84,6 +86,10 @@ public function generateMail( array $mails, string $password = '', ): void { + if (!$this->shareManager->shareApiAllowLinks()) { + return; + } + if (empty($shares)) { return; }