From: Ed B. <eba...@ta...> - 2001-12-10 15:13:56
|
I cut'n'pasted something similar into my addjob.scp.php and vj_closejob.scp= .php files to give me this functionality. if you replace $mailto =3D "$t_useremail"; with=20 $mailto =3D getuseremailaddress($Company); and you've set each school's/department's email address to the principal's = email address, it should do what you want. The getuseremailaddress() = function is below. I'm a PHP/MySQL newbie, so it's probably not the = fastest way to do it, but it works for me. Edward Barrett -- start of getuseremailaddress() -- function getuseremailaddress($ticketdept) { $querydeptintname =3D "SELECT s_user from userdepartments "; = // This gets me $querydeptintname .=3D "WHERE d_name=3D'$ticketdept' ORDER BY = s_user;"; // Internal name of group so I can find email in next query $mysql_result =3D query($querydeptintname); $row =3D mysql_fetch_array($mysql_result); $queryemail =3D "SELECT s_email from security "; // This gets me $queryemail .=3D "WHERE s_user=3D'$row[0]';"; // The email of = the group $mysql_result =3D query($queryemail); $row =3D mysql_fetch_array($mysql_result); $email =3D $row[0]; return $email; } -- end of getuseremailaddress() -- >>> <JFe...@ao...> 12/08/01 03:16PM >>> Hello, I work for a medium sized school system and I am trying to customize = phphelpdesk to better suit our needs. I have setup my departments to = represent each school. I would like to automatically send an email to each = principal of the school/department whenever a ticket is opened for thier = school. I don't want this to be a user available option. Just something = that happens behind the scenes. Here's what I've done so far: --snip-- -- F. Edward Barrett Network Specialist, Traverse Area District Library http://tadl.tcnet.org |