From 4325679a709869a921e9b0b7bfebd6be560090ab Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 7 Apr 2015 20:21:27 -0400 Subject: [PATCH] Display the author in email notifications --- app/Locale/da_DK/translations.php | 1 + app/Locale/de_DE/translations.php | 1 + app/Locale/es_ES/translations.php | 1 + app/Locale/fi_FI/translations.php | 1 + app/Locale/fr_FR/translations.php | 1 + app/Locale/hu_HU/translations.php | 1 + app/Locale/it_IT/translations.php | 1 + app/Locale/ja_JP/translations.php | 1 + app/Locale/nl_NL/translations.php | 1 + app/Locale/pl_PL/translations.php | 1 + app/Locale/pt_BR/translations.php | 1 + app/Locale/ru_RU/translations.php | 1 + app/Locale/sr_Latn_RS/translations.php | 1 + app/Locale/sv_SE/translations.php | 1 + app/Locale/th_TH/translations.php | 1 + app/Locale/tr_TR/translations.php | 1 + app/Locale/zh_CN/translations.php | 1 + app/Model/Notification.php | 9 ++++++++- 18 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 20b57599a..8ccd49486 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index db1c932c6..f76c59035 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index 4026d29c3..91e289762 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 5e15b2843..22dcaab1a 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 7b70183b3..d0d890d6f 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -848,4 +848,5 @@ return array( 'Secret key: ' => 'Clé secrète : ', 'Test your device' => 'Testez votre appareil', 'Assign a color when the task is moved to a specific column' => 'Assigner une couleur lorsque la tâche est déplacée dans une colonne spécifique', + '%s via Kanboard' => '%s via Kanboard', ); diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index 83821f2e0..38829773f 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 892650427..b3a31001b 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index a5f5d70d4..2bf5a5898 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php index e2167dada..bf3629163 100644 --- a/app/Locale/nl_NL/translations.php +++ b/app/Locale/nl_NL/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 2ab71b952..e72bcb16e 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index 4b8900a07..5aea768e0 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -846,4 +846,5 @@ return array( 'Secret key: ' => 'Chave secreta:', 'Test your device' => 'Teste o seu dispositivo', 'Assign a color when the task is moved to a specific column' => 'Atribuir uma cor quando a tarefa é movida em uma coluna específica', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 8eed91344..3e7bb8d0e 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php index 8df5b9f68..1308857ff 100644 --- a/app/Locale/sr_Latn_RS/translations.php +++ b/app/Locale/sr_Latn_RS/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index ab07d8cbd..42c3957b5 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index d777691c8..4d31fb0d9 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php index 67af710f9..2337d5bf0 100644 --- a/app/Locale/tr_TR/translations.php +++ b/app/Locale/tr_TR/translations.php @@ -846,4 +846,5 @@ return array( // 'Secret key: ' => '', // 'Test your device' => '', // 'Assign a color when the task is moved to a specific column' => '', + // '%s via Kanboard' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 5225cf148..507b3691e 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -846,4 +846,5 @@ return array( 'Secret key: ' => '密码:', 'Test your device' => '测试设备', 'Assign a color when the task is moved to a specific column' => '任务移动到指定栏目时设置颜色', + // '%s via Kanboard' => '', ); diff --git a/app/Model/Notification.php b/app/Model/Notification.php index 2b6e6a71f..180891221 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) {