diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-03-16 13:01:17 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-03-16 13:01:17 +0100 |
commit | d7c7808a5e789180f86259ef6a91b17c1bcf737b (patch) | |
tree | b4fb9fa184edefc12cf16d418b3934a40664a61f /lib/private/mail | |
parent | e32f1582c76252ae80802c0851a9583504131dff (diff) | |
download | nextcloud-server-d7c7808a5e789180f86259ef6a91b17c1bcf737b.tar.gz nextcloud-server-d7c7808a5e789180f86259ef6a91b17c1bcf737b.zip |
Add debug log message back
Diffstat (limited to 'lib/private/mail')
-rw-r--r-- | lib/private/mail/mailer.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/private/mail/mailer.php b/lib/private/mail/mailer.php index 83dd050edbc..a995322d89e 100644 --- a/lib/private/mail/mailer.php +++ b/lib/private/mail/mailer.php @@ -10,6 +10,7 @@ namespace OC\Mail; use OCP\IConfig; use OCP\Mail\IMailer; +use OCP\ILogger; /** * Class Mailer provides some basic functions to create a mail message that can be used in combination with @@ -34,15 +35,21 @@ class Mailer implements IMailer { private $instance = null; /** @var IConfig */ private $config; + /** @var ILogger */ + private $logger; /** @var \OC_Defaults */ private $defaults; /** * @param IConfig $config + * @param ILogger $logger * @param \OC_Defaults $defaults */ - function __construct(IConfig $config, \OC_Defaults $defaults) { + function __construct(IConfig $config, + ILogger $logger, + \OC_Defaults $defaults) { $this->config = $config; + $this->logger = $logger; $this->defaults = $defaults; } @@ -67,12 +74,14 @@ class Mailer implements IMailer { */ public function send(Message $message) { if (sizeof($message->getFrom()) === 0) { - $message->setFrom(array(\OCP\Util::getDefaultEmailAddress($this->defaults->getName()))); + $message->setFrom([\OCP\Util::getDefaultEmailAddress($this->defaults->getName())]); } - $failedRecipients = array(); + $failedRecipients = []; $this->getInstance()->send($message->getSwiftMessage(), $failedRecipients); + $logMessage = sprintf('Sent mail to "%s" with subject "%s"', print_r($message->getTo(), true), $message->getSubject()); + $this->logger->debug($logMessage, ['app' => 'core']); return $failedRecipients; } |