Hi guys!I read in old discussions that adding CC fields in NewTicket page was not possible (is it still impossible?), anyway I'm trying to manually append the CC recipient to the auto-mail string with headers but is not working.Probably I'm trying to modify the wrong function.Where is located the php mail function related to the new ticket?Is there any method to add collaborator directly from NewTicket page?Thank you everybody! 

I'm not aware of a working mod currently.

I was thinking about insert into onNewTicket function the creation of a new user (if not existing) getting data from custom fields and add this user as collaborator.Could this work in your opinion?Thank you! Sorry for my insistence but I really need this feature

Sorry, I'm not so deep into the osTicket code, but I'm sure there isa way to get this working - I only can't tell you how to do so or which functions / classes you'll need to alter for such a feature.

Thank you anyway!I've done it!

Would you mind sharing with the rest of us? ;)

6 days later

@[deleted] i would love to know how you got this working?

Is a bit ugly but it work.I've created a custom field (required) in the new ticket cusom form named "CC Email".I've done a bit of reverse engeneering on the database and I noticed that the CC emails entries are stored in "form_entry_values".Practically I added a query for that data at the beginning of "onNewTicket" function ( \include\class.ticket.php):- I select the last entry of that db table where "field_id" is equal to the "CC Email" field id in the table "form_entry_values" - I match the email with the existing emails (make sure to not create two identical users), if it already exist I create a new collaborator associated to this ticket with user_id (matched with the emil in the users table), if it not exist I create a new user with that email and I create a collaborator with his id- When collaborators are added I notify the creation of the ticket to customer and collaboratorsLet me attach some code to be more clear.//-----------------------------------------------------        $sql= "SELECT value,entry_id FROM ost_form_entry_values WHERE field_id='50' OR field_id='51' OR field_id='40'        ORDER BY entry_id DESC LIMIT 1;";     //select CC email        $risul= db_query($sql);        $emailrif = db_fetch_row($risul);    //extract CC email        unset($risul);        $sql= "SELECT user_id FROM ost_user_email WHERE address='$emailrif'";   //already exist?        $risul= db_query($sql);        $idesist=db_fetch_row($risul);        if (isset($idesist))      //if exist        {            if($idesist !== $this->getUserId())//la mail è uguale a quella del cliente?            {                $sql= "SELECT id FROM ost_ticket_collaborator ORDER BY id DESC LIMIT 1;";//seleziono ultimo id collaboratore                $risul= db_query($sql);                $icoll = db_fetch_row($risul);                $icoll+=1;                $idchiam= $this->getId();                $sql="INSERT INTO ost_ticket_collaborator (id,isactive,ticket_id,user_id,role) VALUES ('$icoll','1','$idchiam','$idesist','M')";                db_query($sql);//creo collaboratore con id user che esiste già            }        }        else //not exist        {            $sql= "SELECT id FROM ost_user ORDER BY id DESC LIMIT 1;";//seleziono ultimo id user            $risul= db_query($sql);            $iduser = db_fetch_row($risul);            $iduser+=1;            $sql= "SELECT value,entry_id FROM ost_form_entry_values WHERE field_id='42' OR field_id='46' OR field_id='39'            ORDER BY entry_id DESC LIMIT 1;";//seleziono persona rif            $risul= db_query($sql);            $persona = db_fetch_row($risul);//estraggo persona rif            $sql= "INSERT INTO ost_user (id,org_id,status,name) VALUES ('$iduser','0','0','$persona');";//creo user            db_query($sql);            //------------------------------            $sql= "INSERT INTO ost_user_email (id,user_id,address) VALUES ('$iduser','$iduser','$emailrif');";//creo email            db_query($sql);            $sql= "UPDATE ost_user SET default_email_id='$iduser' WHERE id='$iduser';";            db_query($sql);            //creo collaborator            $sql= "SELECT id FROM ost_ticket_collaborator ORDER BY id DESC LIMIT 1;";//seleziono ultimo id collaboratore            $risul= db_query($sql);            $icoll = db_fetch_row($risul);            $icoll+=1;            $idchiam= $this->getId();            $sql="INSERT INTO ost_ticket_collaborator (id,isactive,ticket_id,user_id,role) VALUES ('$icoll','1','$idchiam','$iduser','M')";//creo collaboratore con utente appena creato            db_query($sql);        }if($autorespond                && $cfg->autoRespONNewTicket()                && $dept->autoRespONNewTicket()                &&  ($msg=$tpl->getAutoRespMsgTemplate())) {            $msg = $this->replaceVars($msg->asArray(),                    array('message' => $message,                          'recipient' => $this->getOwner(),                          'signature' => ($dept && $dept->isPublic())?$dept->getSignature():'')                    );            $email->sendAutoReply($this->getOwner(), $msg, $msg,                null, $options);            $sql="SELECT address ".                 "FROM ost_user_email, ost_ticket_collaborator ".                 "WHERE ost_user_email.id = ost_ticket_collaborator.user_id ".                 "AND ost_ticket_collaborator.ticket_id = '$idchiam';";            $risul= db_query($sql);            $collabor = db_fetch_row($risul);            foreach ($collabor as $dest)                $email->sendAutoReply($dest, $msg, $msg, null, $options);                                }

Write a Reply...