diff options
author | Arnaud Abélard <arnaud.abelard@univ-nantes.fr> | 2015-02-19 00:10:02 +0300 |
---|---|---|
committer | Arnaud Abélard <arnaud.abelard@univ-nantes.fr> | 2015-02-19 00:10:02 +0300 |
commit | bbf5f2f45614266d3fd470a7d2186feb2f2d16dc (patch) | |
tree | 00070712093c4d0bf0217cb3980742e74124c2d8 /plugins/ScheduledReports | |
parent | 7fa76c4ba052b579bd2710e6cdb23175e62f27a9 (diff) |
Adding segment name in report title
Adding segment name in report title (mail subject and filename) in order to allow recipients to differentiate reports when receiving reports on a per-segment basis:
"sitename - segmentname - date" instead of "sitename - date"
Diffstat (limited to 'plugins/ScheduledReports')
-rw-r--r-- | plugins/ScheduledReports/API.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php index 8cb890da67..0c02e7957c 100644 --- a/plugins/ScheduledReports/API.php +++ b/plugins/ScheduledReports/API.php @@ -452,6 +452,11 @@ class API extends \Piwik\Plugin\API list($reportSubject, $reportTitle) = self::getReportSubjectAndReportTitle(Site::getNameFor($idSite), $report['reports']); $filename = "$reportTitle - $prettyDate - $description"; + // if reporting for a segment, use the segment's name in the title + if(is_array($segment) && strlen($segment['name'])) { + $reportTitle .= " - ".$segment['name']; + } + $reportRenderer->renderFrontPage($reportTitle, $prettyDate, $description, $reportMetadata, $segment); array_walk($processedReports, array($reportRenderer, 'renderReport')); |