Skip to content

Commit

Permalink
Merge pull request #1041 from bennet0496/patch-mail-header
Browse files Browse the repository at this point in the history
Adding the Auto-Submitted header for notification mails
  • Loading branch information
susnux authored Oct 18, 2023
2 parents 8738066 + b1ea0fb commit 37c4668
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 37c4668

Please sign in to comment.