public function changelogsendAction() { $products = new AdminProducts(); $buildId = $this->_getParam('build'); $productId = $this->_getParam('id'); $product = $products->getProductById($productId); $lang = 1; $info = $products->getChangelogByBuildId($buildId, $lang); $updateList = ''; foreach ($info as $key => $val) { $updateList .= '- ' . $val['pc_text'] . "\n"; } $subscribers = $products->getSubscribers($productId); $products->getSetSendStatus($info); $mess = "Good day to you!\n\nWe are glad to inform you that " . $this->company_params['name'] . " has released the new version (build) of \"" . $product['p_title'] . "\" - Version " . $product['p_version'] . " (Build " . $product['p_build'] . "), release date: " . date('F jS, Y', strtotime($product['p_date_release'])) . ".\n\nVersion fixes and enhancements:\n" . $updateList . "\n\nTo learn more about the product please visit: " . $product['p_page_link'] . "\n\nTo download the new version (build), please visit: " . $this->company_params['download_prefix'] . $product['p_download'] . "\n\n\nAccording to our purchase policy all registered users can download free upgrades within the major version. All further upgrades can be purchased with discount.\n\nIf you want to upgrade to the most recent build within one major version, just download the latest setup file from product's download page to install the latest build. Your old registration information will be valid for changing the demo into full version within one major version.\n\nIf you are an unregistered user we welcome you to try out and purchase our solutions to discover the full potential of " . $this->company_params['name'] . " cutting edge software.\n\nGlad to keep you informed,\n" . $this->company_params['name']; foreach ($subscribers as $key => $data) { $headers = "MIME-Version: 1.0\n"; $headers .= "X-Priority: 1\n"; $headers .= "X-Mailer: PHP mailer (v0.1)\n"; $headers .= "X-MSMail-Priority: High\n"; $headers .= "From: \"" . $this->company_params['name'] . "\" <" . $this->company_params['contact_email'] . ">\n"; mail($data['user_email'], '"' . $product['p_title'] . '" - ' . $this->company_params['name'] . ' Updates Notifications', $mess, $headers); } header("Location: " . ADMIN_DIR . "/products/changelog/id/" . $productId . "/"); }