diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-04-07 20:21:27 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-04-07 20:21:27 -0400 |
commit | 4325679a709869a921e9b0b7bfebd6be560090ab (patch) | |
tree | 4fc7f715e9ecd5188662c2853bc5ace92eaae3f9 /app/Model/Notification.php | |
parent | e41495a06c3401120a781efdc1a882b85bd5a0cc (diff) |
Display the author in email notifications
Diffstat (limited to 'app/Model/Notification.php')
-rw-r--r-- | app/Model/Notification.php | 9 |
1 files changed, 8 insertions, 1 deletions
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) { |