From 4325679a709869a921e9b0b7bfebd6be560090ab Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 7 Apr 2015 20:21:27 -0400 Subject: Display the author in email notifications --- app/Model/Notification.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/Model/Notification.php') diff --git a/app/Model/Notification.php b/app/Model/Notification.php index 2b6e6a71..18089122 100644 --- a/app/Model/Notification.php +++ b/app/Model/Notification.php @@ -101,11 +101,18 @@ class Notification extends Base public function sendEmails($template, array $users, array $data) { try { + + $author = ''; + + if (Session::isOpen()) { + $author = e('%s via Kanboard', $this->user->getFullname($this->session['user'])); + } + $mailer = Swift_Mailer::newInstance($this->container['mailer']); $message = Swift_Message::newInstance() ->setSubject($this->getMailSubject($template, $data)) - ->setFrom(array(MAIL_FROM => 'Kanboard')) + ->setFrom(array(MAIL_FROM => $author ?: 'Kanboard')) ->setBody($this->getMailContent($template, $data), 'text/html'); foreach ($users as $user) { -- cgit v1.2.3