Skip to content

Commit

Permalink
feat: setting Auto-Submitted for notification mails
Browse files Browse the repository at this point in the history
uses method from nextcloud/server#35876

Signed-off-by: Bennet Becker <dev@bennet.cc>
  • Loading branch information
bennet0496 authored and susnux committed Oct 18, 2023
1 parent 8738066 commit b1ea0fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/MailQueueHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b1ea0fb

Please sign in to comment.