diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-08-17 09:15:38 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-08-17 09:15:38 -0700 |
commit | 44e91721b0edec28b4e37d3c6b8847854c108233 (patch) | |
tree | fe7c34e6a2395bb1ea1c9a597278d1b2aa03ac10 /app/Model | |
parent | 658123a2328867a87da59ca660a7044d99eea22c (diff) |
Fix encoding issue in mail subject
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/Notification.php | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/app/Model/Notification.php b/app/Model/Notification.php index e0f932a4..a92ce73e 100644 --- a/app/Model/Notification.php +++ b/app/Model/Notification.php @@ -2,6 +2,7 @@ namespace Model; +use Core\Translator; use Core\Template; use Event\TaskNotificationListener; use Event\CommentNotificationListener; @@ -114,30 +115,46 @@ class Notification extends Base */ public function getMailSubject($template, array $data) { + Translator::disableEscaping(); + switch ($template) { case 'notification_file_creation': - return t('[%s][New attachment] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][New attachment] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_comment_creation': - return t('[%s][New comment] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][New comment] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_comment_update': - return t('[%s][Comment updated] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][Comment updated] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_subtask_creation': - return t('[%s][New subtask] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][New subtask] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_subtask_update': - return t('[%s][Subtask updated] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][Subtask updated] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_task_creation': - return t('[%s][New task] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][New task] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_task_update': - return t('[%s][Task updated] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][Task updated] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_task_close': - return t('[%s][Task closed] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][Task closed] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_task_open': - return t('[%s][Task opened] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + $subject = t('[%s][Task opened] %s (#%d)', $data['task']['project_name'], $data['task']['title'], $data['task']['id']); + break; case 'notification_task_due': - return t('[%s][Due tasks]', $data['project']); + $subject = t('[%s][Due tasks]', $data['project']); + break; + default: + $subject = t('[Kanboard] Notification'); } - return t('[Kanboard] Notification'); + Translator::enableEscaping(); + + return $subject; } /** |