Exemplo n.º 1
0
            if (isset($emailAddr) && !empty($emailAddr)) {
                date_default_timezone_set('UTC');
                $date = date('F j, Y');
                $textResources = new TextResources('en');
                $serverContext = str_replace('/statusreport.php', '', $_SERVER['SCRIPT_NAME']);
                $pageContext = new PageContext("mail", $textResources, "en", $serverContext);
                $twigVars = array('host' => "http://" . $_SERVER['HTTP_HOST'], 'pageContext' => $pageContext, 'user' => $user, 'date' => $date, 'textResources' => $textResources);
                $message = $this->twig->render('mails/statusreport.twig', $twigVars);
                if (isset($_GET["testMail"])) {
                    MailSender::sendMail($_GET["testMail"], "zSticker Status Update", $message);
                } else {
                    if (isset($_GET["realMail"])) {
                        MailSender::sendMail($emailAddr, "zSticker Status Update", $message);
                    }
                }
                echo "<br/>Sending to: " . $emailAddr . "<br/>" . $message;
            }
        }
    }
}
$statusReport = new StatusReport();
$info = $statusReport->getMailUsers();
//print_r($info);
error_reporting(-1);
set_time_limit(0);
try {
    $statusReport->sendMail($info);
} catch (Exception $e) {
    echo 'Caught exception: ', $e->getMessage(), "\n";
    print_r($e);
}
Exemplo n.º 2
0
 /**
  * Generates a report about the status of the configured connections and returns it.
  *
  * BEWARE! The report may be verbose and most likely includes sensitive information
  * that shouldn't be output publicly or be accessible to unauthorized persons.
  *
  * This may take some time to generate depending on the connectors being used.
  *
  * @return StatusReport newly generated status report
  */
 public function getStatusReport()
 {
     return StatusReport::generate($this->connector_map);
 }