Exemplo n.º 1
0
 private function sendMail($subject, $body)
 {
     $feedbackEmailAddress = Config::getInstance()->General['feedback_email_address'];
     $subject = '[ Feedback Feature - Piwik ] ' . $subject;
     $body = Common::unsanitizeInputValue($body) . "\n" . 'Piwik ' . Version::VERSION . "\n" . 'IP: ' . IP::getIpFromHeader() . "\n" . 'URL: ' . Url::getReferrer() . "\n";
     $mail = new Mail();
     $mail->setFrom(Piwik::getCurrentUserEmail());
     $mail->addTo($feedbackEmailAddress, 'Piwik Team');
     $mail->setSubject($subject);
     $mail->setBodyText($body);
     @$mail->send();
 }
Exemplo n.º 2
0
 public static function template_reportParametersScheduledReports(&$out)
 {
     $view = new View('@ScheduledReports/reportParametersScheduledReports');
     $view->currentUserEmail = Piwik::getCurrentUserEmail();
     $view->reportType = self::EMAIL_TYPE;
     $view->defaultDisplayFormat = self::DEFAULT_DISPLAY_FORMAT;
     $view->defaultEmailMe = self::EMAIL_ME_PARAMETER_DEFAULT_VALUE ? 'true' : 'false';
     $view->defaultEvolutionGraph = self::EVOLUTION_GRAPH_PARAMETER_DEFAULT_VALUE ? 'true' : 'false';
     $out .= $view->render();
 }
Exemplo n.º 3
0
 public function sendBug()
 {
     Piwik::checkUserHasSomeAdminAccess();
     $idSite = Common::getRequestVar('idSite', null, 'int');
     $email = Common::getRequestVar('email', null);
     $name = Common::getRequestVar('name', null);
     $website = Common::getRequestVar('website', null);
     $message = Common::getRequestVar('message', null);
     $jsonConfig = json_decode(file_get_contents(getcwd() . '/plugins/Chat/plugin.json'), true);
     if ($idSite != null && $email != null && $name != null && $website != null && $message != null) {
         $mail = new Mail();
         $mail->setFrom($email != null ? $email : Piwik::getCurrentUserEmail(), $name != null ? $name : Piwik::getCurrentUserLogin());
         $mail->setSubject("Bug report");
         $mail->setBodyHtml("Piwik Version : " . Version::VERSION . "<br />\n            Chat Version : " . $jsonConfig['version'] . "<br />\n            Website : " . $website . "<br /><br /><br />\n            Message:<br />" . $message);
         $mail->addTo($jsonConfig['authors'][0]['email']);
         try {
             $mail->send();
         } catch (Exception $e) {
             throw new Exception("An error occured while sending 'Bug Report' to " . implode(', ', $mail->getRecipients()) . " Error was '" . $e->getMessage() . "'");
         }
         return true;
     }
 }