diff options
Diffstat (limited to 'plugins/Feedback/API.php')
-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) |