Page 1 of 1

Email

Posted: Fri May 14, 2004 12:16 pm
by Napoleao

Code: Select all

if ($_REQUEST['do'] == "close") {

	if (p_ticket('close')) {
		$db->query("UPDATE ticket SET is_open = 0, date_closed = '$now_' WHERE id = '$id'");
		ticketlog($id, 'close');
		if ($_REQUEST[email] == '1') {
			$ticket = $db->query_return("SELECT * FROM ticket WHERE id = '$id'");
			$user_details = $db->query_return("SELECT * FROM user WHERE id = '$ticket[userid]'");
			$user_details = update_user_details($user_details);;
			eval(makeemaileval('message', 'BODY_question_closed', $subject, $ticket));
			dp_mail($user_details['email'], $subject, trim($message));
			ticketlog($ticket['id'], 'email_sent_to_user', NULL, NULL, "To: $user_details[email], Subject: $subject");
		}
		jump("ticketview.php?id=$id", "The ticket has been closed");
	}
}
?>
I have the following code (not done by me) How can I add a piece of code so that everytime that funcition is activated it emails 3 users. I am still learning php, hope someone can point me to the right direction. Thanks

Posted: Fri May 14, 2004 12:54 pm
by launchcode
Look at the example code in the mail() function.

http://uk2.php.net/mail

Stick it after the final ticketlog() line.