getTechnician()->getFirstName().' '.$schedule->getTechnician()->getLastName(); $tech_email = $schedule->getTechnician()->getEmail(); //var_dump(get_class_methods('Workorder')); //exit; $workorders = $schedule->getWorkorders(); $tech = $schedule->getTechnician(); $workorders = $schedule->sortWorkorder($workorders); $output = ""; for($i=0; $i < count($workorders); $i++){ if($workorders[$i]->getExactTime()) $output .= "This job starts exactly at: ".$workorders[$i]->convertTime($workorders[$i]->getJobStart())."
"; else $output .= $workorders[$i]->convertTime($workorders[$i]->getJobStart())."
"; $output .= "".$workorders[$i]->getClient()->getClientName()."
"; $output .= "(".$workorders[$i]->getClient()->getClientIdentification().")
"; $output .= $workorders[$i]->getClient()->getAddress() . ' ' . $workorders[$i]->getClient()->getAddress2() . ' '. $workorders[$i]->getClient()->getCity() . ', '. $workorders[$i]->getClient()->getState() . ' ' . $workorders[$i]->getClient()->getZip()."
"; $output .= $workorders[$i]->getClient()->getAttn().' '.$workorders[$i]->getClient()->getPhone()."
"; $output .= "Main Contact: ".$workorders[$i]->getClient()->getAttn().' '.$workorders[$i]->getClient()->getPhone()."
"; $output .= "Requested By: ".$workorders[$i]->getCaller()."
"; $output .= "Reason: ".$job_reason[$workorders[$i]->getReason()]."
Remarks:
"; $output .= $workorders[$i]->getRemarks()."
"; $output .= "
"; } $style=""; $messsage = ''." $tech_name's Schedule". "". "$styleComments:
$emailComment

". "$output
"; //$tech_email = "starkisspk@yahoo.com"; //$tech_email = "jaking17@gmail.com"; //$tech_email = "accellatest@gmail.com"; //$tech_email = "csewell2008@gmail.com"; $headers = 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n"; $headers .= 'From: Atlantic Biomedical ' . "\n"; file_put_contents('/home/ryan/sites/accella/abc/web/t/email.html',$messsage); if( !empty($tech_name) and !empty($tech_email) ) { /***************************************/ $mail=new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port $mail->Username = "schedule@atlanticbiomedical.com"; // GMAIL username $mail->Password = "success4"; // GMAIL password $mail->From = "schedule@atlanticbiomedical.com"; $mail->FromName = "AtlanticBiomedical Schedule"; $mail->Subject = "$tech_name's Atlantic Biomedical Schedule " . $date; $mail->Body = $messsage; //HTML Body $mail->AltBody = "HTML IS REQUIRED TO VIEW"; //Text Body $mail->WordWrap = 50; // set word wrap $mail->AddAddress("$tech_email","$tech_name"); $mail->AddReplyTo("schedule@atlanticbiomedical.com","Schedules"); $mail->AddCC("chris.endres@gmail.com","Chris Endres"); //$mail->AddAttachment("/path/to/file.zip"); // attachment //$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment $result = $mail->Send(); /***************************************/ if(!$result){ echo "ERROR
Unable to Email
"; echo "Email:
$tech_email
"; echo "TechName:
$tech_name
"; }else echo "Email was sent to
$tech_name at
$tech_email
"; }elseif(empty($tech_name)){ echo "ERROR
Unknown Tech
"; echo "Email:
$tech_email
"; } else{ echo "ERROR
No Tech Email
"; echo "TechName:
$tech_name
"; } echo ""; ?>