Display the author in email notifications

This commit is contained in:
Frederic Guillot
2015-04-07 20:21:27 -04:00
parent e41495a06c
commit 4325679a70
18 changed files with 25 additions and 1 deletions

View File

@@ -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) {