function prepareNewsletterIssue($newsletterIssueObject) { $newsletterIni = eZINI::instance('jajnewsletter.ini'); $baseURI = $newsletterIni->variable('ServerSettings', 'BaseURI'); $premailer = $newsletterIni->variable('ServerSettings', 'Premailer'); $analyticsTracking = $newsletterIni->variable('NewsletterSettings', 'AnalyticsTracking'); $dataMap =& $newsletterIssueObject->dataMap(); $mainNode = $newsletterIssueObject->mainNode(); $url = $baseURI . "/" . $mainNode->url(); $cmd = extension_path("jajnewsletter") . "/" . $premailer; $cmd .= " " . escapeshellarg($url); if ($analyticsTracking) { $campaign = urlencode($dataMap['name']->content()); $querystring = "utm_source=newsletter&utm_medium=email&utm_campaign=" . $campaign; $cmd .= " --querystring " . escapeshellarg($querystring); } //echo $cmd; exec($cmd, $output, $return_var); if ($return_var != 0) { return false; } $messageBody = join("\n", $output); $cmd .= " --plaintext"; exec($cmd, $outputPlain, $return_var); if ($return_var != 0) { return false; } $plainBody = join("\n", $outputPlain); // TODO: Check for secret sign that everything was generated ok // TODO: Compress html (remove repeated whitespace) return array('html' => $messageBody, 'plain' => $plainBody); }
| Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::make("Be right back!", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; require app_path() . '/helpers.php'; /* |-------------------------------------------------------------------------- | Require the Extensions |--------------------------------------------------------------------------| */ foreach (glob(extension_path() . '/*.php') as $ext) { require $ext; }