2014-02-17 21:26:52 +04:00
|
|
|
<?php
|
|
|
|
/**
|
2016-07-21 18:07:57 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Björn Schießle <bjoern@schiessle.org>
|
2016-07-21 18:07:57 +03:00
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
2016-01-12 17:02:16 +03:00
|
|
|
* @author Robin McCorkell <robin@mccorkell.me.uk>
|
2016-07-21 18:07:57 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
2016-01-12 17:02:16 +03:00
|
|
|
* @author scolebrook <scolebrook@mac.com>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Vincent Petry <pvince81@owncloud.com>
|
2015-03-26 13:44:34 +03:00
|
|
|
*
|
|
|
|
* @license AGPL-3.0
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*
|
|
|
|
*/
|
2015-02-26 13:37:37 +03:00
|
|
|
|
2014-02-17 21:26:52 +04:00
|
|
|
namespace OC\Share;
|
|
|
|
|
2015-04-10 18:21:52 +03:00
|
|
|
use OCP\IL10N;
|
2016-03-14 17:19:55 +03:00
|
|
|
use OCP\IURLGenerator;
|
2015-12-01 14:05:40 +03:00
|
|
|
use OCP\IUser;
|
2015-04-10 18:21:52 +03:00
|
|
|
use OCP\Mail\IMailer;
|
|
|
|
use OCP\ILogger;
|
|
|
|
use OCP\Defaults;
|
2015-12-01 14:05:40 +03:00
|
|
|
use OCP\Util;
|
2014-05-13 14:21:04 +04:00
|
|
|
|
2015-04-10 18:21:52 +03:00
|
|
|
/**
|
|
|
|
* Class MailNotifications
|
|
|
|
*
|
|
|
|
* @package OC\Share
|
|
|
|
*/
|
2014-02-17 21:26:52 +04:00
|
|
|
class MailNotifications {
|
|
|
|
|
2015-12-01 14:05:40 +03:00
|
|
|
/** @var IUser sender userId */
|
|
|
|
private $user;
|
2015-04-10 18:21:52 +03:00
|
|
|
/** @var string sender email address */
|
|
|
|
private $replyTo;
|
|
|
|
/** @var string */
|
2014-02-17 21:26:52 +04:00
|
|
|
private $senderDisplayName;
|
2015-04-10 18:21:52 +03:00
|
|
|
/** @var IL10N */
|
2014-02-17 21:26:52 +04:00
|
|
|
private $l;
|
2015-04-10 18:21:52 +03:00
|
|
|
/** @var IMailer */
|
|
|
|
private $mailer;
|
|
|
|
/** @var Defaults */
|
|
|
|
private $defaults;
|
|
|
|
/** @var ILogger */
|
|
|
|
private $logger;
|
2016-03-14 17:19:55 +03:00
|
|
|
/** @var IURLGenerator */
|
|
|
|
private $urlGenerator;
|
2014-02-17 21:26:52 +04:00
|
|
|
|
|
|
|
/**
|
2015-12-01 14:05:40 +03:00
|
|
|
* @param IUser $user
|
2015-04-10 18:21:52 +03:00
|
|
|
* @param IL10N $l10n
|
|
|
|
* @param IMailer $mailer
|
|
|
|
* @param ILogger $logger
|
|
|
|
* @param Defaults $defaults
|
2016-03-14 17:19:55 +03:00
|
|
|
* @param IURLGenerator $urlGenerator
|
2014-02-17 21:26:52 +04:00
|
|
|
*/
|
2015-12-01 14:05:40 +03:00
|
|
|
public function __construct(IUser $user,
|
2015-04-10 18:21:52 +03:00
|
|
|
IL10N $l10n,
|
|
|
|
IMailer $mailer,
|
|
|
|
ILogger $logger,
|
2016-03-14 17:19:55 +03:00
|
|
|
Defaults $defaults,
|
|
|
|
IURLGenerator $urlGenerator) {
|
2015-04-10 18:21:52 +03:00
|
|
|
$this->l = $l10n;
|
2015-12-01 14:05:40 +03:00
|
|
|
$this->user = $user;
|
2015-04-10 18:21:52 +03:00
|
|
|
$this->mailer = $mailer;
|
|
|
|
$this->logger = $logger;
|
|
|
|
$this->defaults = $defaults;
|
2016-03-14 17:19:55 +03:00
|
|
|
$this->urlGenerator = $urlGenerator;
|
2015-04-10 18:21:52 +03:00
|
|
|
|
2015-12-01 14:05:40 +03:00
|
|
|
$this->replyTo = $this->user->getEMailAddress();
|
|
|
|
$this->senderDisplayName = $this->user->getDisplayName();
|
2014-02-17 21:26:52 +04:00
|
|
|
}
|
|
|
|
}
|