irm-1.6-b3/include/tracking.class.php
/* Send e-mail to all people interested in this ticket.
	 * If $mod is 'yes', then this is a notification of a change to an
	 * existing ticket.  Otherwise, we're sending notification of a new
	 * ticket being created.
	 */
Send e-mail to all people interested in this ticket.
If $mod is 'yes', then this is a notification of a change to an
existing ticket.  Otherwise, we're sending notification of a new
ticket being created.
Send e - mail to all people interested in this ticket . If $mod is ' yes ' then this is a notification of a change to an existing ticket . Otherwise we ' re sending notification of a new ticket being created .
function sendEmail($mod="no")
	{
		global $IRMName;
		if(!Config::Get('notifyassignedbyemail')
		    && !Config::Get('userupdates')
		    && !Config::Get('notifynewtrackingbyemail'))
		{
			return;
		}
		$recipients = array();
		if(Config::Get('notifyassignedbyemail')
		   && $this->Assign != $IRMName)
		{
			$assignUser = new User($this->Assign);
			if ($assignUser->getEmail())
			{
				$recipients[] = $assignUser->getEmail();
			}
		}
		if(Config::Get('userupdates')
		   && $this->EmailUpdatesToAuthor == "yes"
		   && $this->AuthorEmail != ""
		   && $IRMName != $this->Author)
		{
			$recipients[] = $this->AuthorEmail;
		}
		if(Config::Get('notifynewtrackingbyemail'))
		{
			$recipients = array_merge($recipients, split('[^a-zA-Z0-9@_\.]+', Config::Get('newtrackingemail')));
		}
		$recipients = array_merge($recipients, split('[^a-zA-Z0-9_\.@]', $this->OtherEmails));
				$currentUser = new User($IRMName);
		$sender = $currentUser->getEmail();
				$body = $this->mailBody();
		$body = str_replace("<br>", "\n", $body);
		$body = str_replace("<p>", "\n\n", $body);
		$body = str_replace("<br />" , "\n", $body);
		$body = strip_tags($body);
		if($mod == "no"){
			$subject = sprintf(_("IRM: New Job %s has been ADDED to the work request system."), $this->ID);
		} else if ($this->Status == "complete") {
                          $subject = sprintf(_("IRM: Job %s has been COMPLETED by %s"), $this->ID, $IRMName);
                } else {
			$subject = sprintf(_("IRM: Job %s has been MODIFIED by %s"), $this->ID, $IRMName);
		}
		$headers = "";
		$headers .= "From: $sender\n";
		$headers .= "X-From-IRM: IRM\n ";
		foreach ($recipients as $r)
		{
			if ($r)
			{
				mail($r, $subject, $body, $headers);
			}
		}
	}
function sendEmail ( $ mod = " no " ) { global $ IRMName ; if ( ! Config :: Get ( 'notifyassignedbyemail' ) && ! Config :: Get ( 'userupdates' ) && ! Config :: Get ( 'notifynewtrackingbyemail' ) ) { return ; } $ recipients = array ( ) ; if ( Config :: Get ( 'notifyassignedbyemail' ) && $ this -> Assign != $ IRMName ) { $ assignUser = new User ( $ this -> Assign ) ; if ( $ assignUser -> getEmail ( ) ) { $ recipients [ ] = $ assignUser -> getEmail ( ) ; } } if ( Config :: Get ( 'userupdates' ) && $ this -> EmailUpdatesToAuthor == " yes " && $ this -> AuthorEmail != " " && $ IRMName != $ this -> Author ) { $ recipients [ ] = $ this -> AuthorEmail ; } if ( Config :: Get ( 'notifynewtrackingbyemail' ) ) { $ recipients = array_merge ( $ recipients , split ( '[^a-zA-Z0-9@_\.]+' , Config :: Get ( 'newtrackingemail' ) ) ) ; } $ recipients = array_merge ( $ recipients , split ( '[^a-zA-Z0-9_\.@]' , $ this -> OtherEmails ) ) ; $ currentUser = new User ( $ IRMName ) ; $ sender = $ currentUser -> getEmail ( ) ; $ body = $ this -> mailBody ( ) ; $ body = str_replace ( " <br> " , " \n " , $ body ) ; $ body = str_replace ( " <p> " , " \n \n " , $ body ) ; $ body = str_replace ( " <br /> " , " \n " , $ body ) ; $ body = strip_tags ( $ body ) ; if ( $ mod == " no " ) { $ subject = sprintf ( _ ( " IRM: New Job %s has been ADDED to the work request system. " ) , $ this -> ID ) ; } else if ( $ this -> Status == " complete " ) { $ subject = sprintf ( _ ( " IRM: Job %s has been COMPLETED by %s " ) , $ this -> ID , $ IRMName ) ; } else { $ subject = sprintf ( _ ( " IRM: Job %s has been MODIFIED by %s " ) , $ this -> ID , $ IRMName ) ; } $ headers = " " ; $ headers .= " From:  $ sender \n " ; $ headers .= " X-From-IRM: IRM \n " ; foreach ( $ recipients as $ r ) { if ( $ r ) { mail ( $ r , $ subject , $ body , $ headers ) ; } } }
Send e-mail to all people interested in this ticket.
Send e - mail to all people interested in this ticket .
// First, work out who's going to get this missive // Assignee // Author // E-mail addresses that get copies of all tracking e-mails // People who have signed on to get info on this ticket // Who do we send it from?
 // What are we going to tell them?
