diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-05-13 09:43:47 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-05-13 09:43:47 +0400 |
commit | 56aedb8f50898a772b0b8d08be91aa69bbc011e5 (patch) | |
tree | 069cfa3591367940aefd66f3d3819402ae103fbc /plugins/Feedback | |
parent | 338d3ad1cec58ddd8aebd7aedaf882eef3bcfa86 (diff) |
Refs #4877 Tweak the feedback@piwik email subject ftw
Diffstat (limited to 'plugins/Feedback')
-rw-r--r-- | plugins/Feedback/API.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/Feedback/API.php b/plugins/Feedback/API.php index 73b3dbaf02..b5d601cb66 100644 --- a/plugins/Feedback/API.php +++ b/plugins/Feedback/API.php @@ -44,13 +44,20 @@ class API extends \Piwik\Plugin\API } $body = sprintf("Feature: %s\nLike: %s\n", $featureName, $likeText, $message); - if (!empty($message)) { - $body .= sprintf("Feedback:\n%s\n", $message); - } else { - $body .= "No feedback\n"; + + $feedbackMessage = ''; + if (!empty($message) && $message != 'undefined') { + $feedbackMessage = sprintf("Feedback:\n%s\n", trim($message)); } + $body .= $feedbackMessage; + + $subject = sprintf("%s for %s %s", + empty($like) ? "-1" : "+1", + $featureName, + empty($feedbackMessage) ? "" : "(w/ feedback)" + ); - $this->sendMail($featureName, $body); + $this->sendMail($subject, $body); } private function sendMail($subject, $body) |