diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-02-18 19:13:08 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-02-18 19:13:08 -0500 |
commit | bd0ed331797717ff9db63216df550d95674ba248 (patch) | |
tree | 0f3fbe140b26274ab5ac80b74aa7a29d37b0689b /app/Core/Mail/Client.php | |
parent | b4dc602381a367ce9ed1a1bbe28b7903976fdabe (diff) |
Add Reply-To header to emails sent from Kanboard
Diffstat (limited to 'app/Core/Mail/Client.php')
-rw-r--r-- | app/Core/Mail/Client.php | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/app/Core/Mail/Client.php b/app/Core/Mail/Client.php index ee3bdead..334f8816 100644 --- a/app/Core/Mail/Client.php +++ b/app/Core/Mail/Client.php @@ -9,7 +9,7 @@ use Kanboard\Core\Base; /** * Mail Client * - * @package mail + * @package Kanboard\Core\Mail * @author Frederic Guillot */ class Client extends Base @@ -38,30 +38,35 @@ class Client extends Base * Send a HTML email * * @access public - * @param string $email - * @param string $name + * @param string $recipientEmail + * @param string $recipientName * @param string $subject * @param string $html * @return Client */ - public function send($email, $name, $subject, $html) + public function send($recipientEmail, $recipientName, $subject, $html) { - if (! empty($email)) { - $this->queueManager->push(EmailJob::getInstance($this->container) - ->withParams($email, $name, $subject, $html, $this->getAuthor()) - ); + if (! empty($recipientEmail)) { + $this->queueManager->push(EmailJob::getInstance($this->container)->withParams( + $recipientEmail, + $recipientName, + $subject, + $html, + $this->getAuthorName(), + $this->getAuthorEmail() + )); } return $this; } /** - * Get email author + * Get author name * * @access public * @return string */ - public function getAuthor() + public function getAuthorName() { $author = 'Kanboard'; @@ -73,6 +78,22 @@ class Client extends Base } /** + * Get author email + * + * @access public + * @return string + */ + public function getAuthorEmail() + { + if ($this->userSession->isLogged()) { + $userData = $this->userSession->getAll(); + return ! empty($userData['email']) ? $userData['email'] : ''; + } + + return ''; + } + + /** * Get mail transport instance * * @access public |