diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2018-11-02 04:43:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-02 04:43:02 +0300 |
commit | fcd604b0bc1fdbb4f741a99a58abdc93dd25fd57 (patch) | |
tree | 2da86bb4c3526084599bd6e7a79a3caaeea913c4 /plugins | |
parent | 44a9f9348658630e6993876655e4db618f2bfa65 (diff) |
make it possible for plugins to change content of JS Tracking Code Missing Email through DI (#13658)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreAdminHome/Emails/JsTrackingCodeMissingEmail.php | 4 | ||||
-rw-r--r-- | plugins/CoreAdminHome/Tasks.php | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/plugins/CoreAdminHome/Emails/JsTrackingCodeMissingEmail.php b/plugins/CoreAdminHome/Emails/JsTrackingCodeMissingEmail.php index 5dde04403c..c48453e1ee 100644 --- a/plugins/CoreAdminHome/Emails/JsTrackingCodeMissingEmail.php +++ b/plugins/CoreAdminHome/Emails/JsTrackingCodeMissingEmail.php @@ -77,12 +77,12 @@ class JsTrackingCodeMissingEmail extends Mail $this->setWrappedHtmlBody($this->getDefaultBodyView()); } - private function getDefaultSubject() + protected function getDefaultSubject() { return Piwik::translate('CoreAdminHome_MissingTrackingCodeEmailSubject', ["'" . Site::getNameFor($this->idSite) . "'"]); } - private function getDefaultBodyView() + protected function getDefaultBodyView() { $view = new View('@CoreAdminHome/_jsTrackingCodeMissingEmail.twig'); $view->login = $this->login; diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index 719aa6b40d..0d051f5b6c 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -12,6 +12,7 @@ use Piwik\API\Request; use Piwik\ArchiveProcessor\Rules; use Piwik\Archive\ArchivePurger; use Piwik\Config; +use Piwik\Container\StaticContainer; use Piwik\DataAccess\ArchiveTableCreator; use Piwik\Date; use Piwik\Db; @@ -114,7 +115,12 @@ class Tasks extends \Piwik\Plugin\Tasks return; } - $email = new JsTrackingCodeMissingEmail($user['login'], $user['email'], $idSite); + $container = StaticContainer::getContainer(); + $email = $container->make(JsTrackingCodeMissingEmail::class, array( + 'login' => $user['login'], + 'emailAddress' => $user['email'], + 'idSite' => $idSite + )); $email->send(); } |