Cron job problem for email notification


(system) #1

arnabnaha wrote on Sunday, February 20, 2011:

Hi
I am running openemr 4.0 on windows xp. when i run the cronjob using scheduled task and mozilla firefox (latest version), i get the following on the web page:

Total “.count($db_patient).” Records Found\n"; for($p=0;$p< $check_date) { $app_date = date(“Y-m-d”)." “.$prow; }else{ $app_date = $prow.” “.$prow; } */ $app_date = $prow.” “.$prow; $app_time = strtotime($app_date); $app_time_hour = round($app_time/3600); $curr_total_hour = round(time()/3600); $remaining_app_hour = round($app_time_hour - $curr_total_hour); $remain_hour = round($remaining_app_hour - $EMAIL_NOTIFICATION_HOUR); $strMsg = “\n========================”.$TYPE.” || “.date(“Y-m-d H:i:s”).”========================="; $strMsg .= “\nSEND NOTIFICATION BEFORE:”.$EMAIL_NOTIFICATION_HOUR." || CRONJOB RUN EVERY:".$CRON_TIME." || APPDATETIME:".$app_date." || REMAINING APP HOUR:".($remaining_app_hour)." || SEND ALERT AFTER:".($remain_hour); if($remain_hour >= -($CRON_TIME) && $remain_hour <= $CRON_TIME) { // insert entry in notification_log table cron_InsertNotificationLogEntry($TYPE,$prow,$db_email_msg); //set message $db_email_msg = cron_setmessage( $prow, $db_email_msg ); // send mail to patinet cron_SendMail( $prow, $db_email_msg, $db_email_msg, $db_email_msg ); //update entry >> pc_sendalertemail=‘Yes’ cron_updateentry($TYPE,$prow,$prow); $strMsg .= " || ALERT SENT SUCCESSFULLY TO “.$prow; $strMsg .= “\n”.$patient_info.”\n".$smsgateway_info."\n".$data_info."\n".$db_email_msg; } WriteLog( $strMsg ); // larry :: get notification data again - since was updated by cron_updateentry // todo :: instead fix not to modify the template aka $db_email_msg $db_email_msg = cron_getNotificationData($TYPE); } sqlClose(); ?>

please help…
Dr. Arnab Naha


(system) #2

arnabnaha wrote on Sunday, February 20, 2011:

Hi all

It was my bad….Sorry for creating an unnecessary topic in the forum… the error was due to the scheduled task properties problem…fixed it…and working smooth…


(system) #3

arnabnaha wrote on Sunday, February 20, 2011:

Issue:

when mail is sent from the automatic notification i.e cronjob…it comes in the mail inbox of the patient as an attachment with the name “noname”. cant it be modified to be sent without attachment and as only as a plain text in the email???
Please help.