diff options
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 |