Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKate Butler <kate@innocraft.com>2019-08-26 01:04:01 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2019-08-26 01:04:01 +0300
commit64bcf78cf9bf45319f9b7a5d8ebbe10e1970e952 (patch)
tree427c32f94c7174d85725e65f613eb396047278bb /plugins/Installation/Controller.php
parent444e8415ed5e0771213be972bd96249f091fdbf1 (diff)
Send tracking code JS by email (#14569)
* Button to email standard install instructions on installation page 7 and no data tracked yet page * Send tracking code email from the tracking code generator page * Escape HTML tags * Send email in plain text * Move email button next to header * Fix width of header div * Update reference screenshots * PR fixes * Expand tracking code email template * Fix double escaping of message * Hide links to Matomo for whitelabel, fix missing space * ignore event in documentation * Update reference screenshots * Changes to email template * fix missing translation key * Add idsite and tracking url to email template * Fix extra slash in URL * Update UI test
Diffstat (limited to 'plugins/Installation/Controller.php')
-rw-r--r--plugins/Installation/Controller.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php
index fce3c42fc4..6deebbb8f7 100644
--- a/plugins/Installation/Controller.php
+++ b/plugins/Installation/Controller.php
@@ -376,11 +376,27 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$siteName = Common::unsanitizeInputValue($this->getParam('site_name'));
$idSite = $this->getParam('site_idSite');
+ $javascriptGenerator = new TrackerCodeGenerator();
+ $jsTag = $javascriptGenerator->generate($idSite, Url::getCurrentUrlWithoutFileName());
+ $rawJsTag = TrackerCodeGenerator::stripTags($jsTag);
+
+ $showMatomoLinks = true;
+ Piwik::postEvent('SitesManager.showMatomoLinksInTrackingCodeEmail', array(&$showMatomoLinks));
+
+ $trackingUrl = trim(SettingsPiwik::getPiwikUrl(), '/') . '/' . $javascriptGenerator->getPhpTrackerEndpoint();
+
+ $emailBody = $this->renderTemplateAs('@SitesManager/_trackingCodeEmail', array(
+ 'jsTag' => $rawJsTag,
+ 'showMatomoLinks' => $showMatomoLinks,
+ 'trackingUrl' => $trackingUrl,
+ 'idSite' => $idSite
+ ), $viewType = 'basic');
+
// Load the Tracking code and help text from the SitesManager
$viewTrackingHelp = new \Piwik\View('@SitesManager/_displayJavascriptCode');
$viewTrackingHelp->displaySiteName = $siteName;
- $javascriptGenerator = new TrackerCodeGenerator();
- $viewTrackingHelp->jsTag = $javascriptGenerator->generate($idSite, Url::getCurrentUrlWithoutFileName());
+ $viewTrackingHelp->jsTag = $jsTag;
+ $viewTrackingHelp->emailBody = $emailBody;
$viewTrackingHelp->idSite = $idSite;
$viewTrackingHelp->piwikUrl = Url::getCurrentUrlWithoutFileName();
$viewTrackingHelp->isInstall = true;