From b1ea0fbb3696ed510c45a5c6366225387891df32 Mon Sep 17 00:00:00 2001 From: Bennet Becker Date: Mon, 26 Dec 2022 23:48:00 +0100 Subject: [PATCH] feat: setting Auto-Submitted for notification mails uses method from nextcloud/server#35876 Signed-off-by: Bennet Becker --- lib/MailQueueHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/MailQueueHandler.php b/lib/MailQueueHandler.php index 3b44e63ae..80b7d08ef 100644 --- a/lib/MailQueueHandler.php +++ b/lib/MailQueueHandler.php @@ -35,6 +35,7 @@ use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; +use OCP\Mail\Headers\AutoSubmitted; use OCP\Mail\IMailer; use OCP\RichObjectStrings\InvalidObjectExeption; use OCP\RichObjectStrings\IValidator; @@ -375,6 +376,9 @@ protected function sendEmailToUser($userName, $email, $lang, $timezone, $maxTime $message->useTemplate($template); $message->setFrom([$this->getSenderData('email') => $this->getSenderData('name')]); + // We don't want auto generated responses to autogenerated activity notifications + $message->setAutoSubmitted(AutoSubmitted::VALUE_AUTO_GENERATED); + try { $this->mailer->send($message); } catch (\Exception $e) {