if ($type > 1) { /* Now include the followups */ $result2=$this->getMessages(); $rows=db_numrows($result2); if ($result2 && $rows > 0) { for ($i=0; $i<$rows; $i++) { // // for messages posted by non-logged-in users, // we grab the email they gave us // // otherwise we use the confirmed one from the users table // if (db_result($result2,$i,'user_id') == 100) { $emails[] = db_result($result2,$i,'from_email'); } else { $monitor_ids[] = db_result($result2,$i,'user_id'); } $body .= "\n\n"; if ($i == 0) { $body .= $this->marker('details',$changes); } $body .= "Comment By: ". db_result($result2,$i,'realname') . " (".db_result($result2,$i,'user_name').")". "\nDate: ". date( $sys_datefmt,db_result($result2,$i,'adddate') ). "\n\nMessage:". "\n".util_unconvert_htmlspecialchars( db_result($result2,$i,'body') ). "\n\n----------------------------------------------------------------------"; } } } $body .= "\n\nYou can respond by visiting: ". "\nhttp://".$GLOBALS['sys_default_domain']."/tracker/?func=detail&atid=". $this->ArtifactType->getID() . "&aid=". $this->getID() . "&group_id=". $this->ArtifactType->Group->getID(); //only send if some recipients were found if (count($emails) < 1 && count($monitor_ids) < 1) { return true; } if (count($monitor_ids) < 1) { $monitor_ids=array(); } else { $monitor_ids=array_unique($monitor_ids); } $from = $this->ArtifactType->getReturnEmailAddress(); $extra_headers = 'Reply-to: '.$from; // load the e-mail addresses of the users $users =& user_get_objects($monitor_ids); if (count($users) > 0) { foreach ($users as $user) { if ($user->getStatus() == "A") { //we are only sending emails to active users $emails[] = $user->getEmail(); } } } // print($body); //now remove all duplicates from the email list if (count($emails) > 0) { $BCC=implode(',',array_unique($emails)); util_send_message('',$subject,$body,$from,$BCC,'',$extra_headers); } //util_handle_message($monitor_ids,$subject,$body,$BCC); return true; }