Esempio n. 1
0
$config = new Zend_Config_Ini($apppath . '/application/configs/application.ini');
Zend_Registry::set('config', $config->production);
// Because our models need it this way
// Get the messages model
$weeklyreport = new Application_Model_Report();
//$r = $weeklyreport->getMonthlyReportApiuser();
//echo '<pre>'; print_r($r);
//exit;
// Set up our current timestamp
$timestamp = date('Y-m-d H:i:s');
// Log the start of this read
logWrite("####################################");
logWrite("Begin batch send: {$timestamp}");
logWrite("------------------------------------");
// Get the queue and counts
$sendReportsTo = $weeklyreport->sendMonthlyRportTo();
$queueCount = count($sendReportsTo);
$sendCount = 0;
// Log our counts
logWrite("Number of persons to whom report will bse sent: {$queueCount}\nBegin send loop:");
//logWrite("")
//logWrite("")
echo '<pre>';
print_r($sendReportsTo);
if (is_array($sendReportsTo)) {
    if (!empty($sendReportsTo)) {
        foreach ($sendReportsTo as $ars => $user) {
            $mail = new Zend_Mail();
            $mail->setFrom('*****@*****.**', 'Textmunication.com');
            $mail->addTo($user['email']);
            $mail->setSubject('Monthly Reports');