Jump to content

Create tickets from email log


Hotlinks

Recommended Posts

WHMCS rather annoyingly doesnt create tickets when the department email is a CC rather than To.

 

Here is a module to view those tickets and decide whether to create a ticket or not.

 

I did this the simplest way possible which was to just send out another mail with the chosen department as a To recipient.

 

I called it tickets.php and put it in whmcs/modules/admin

 

Use at your own risk, enjoy!

 

Panny

 

<table border=1>
<?

// configuration
 $departments = array("sales", "support", "accounts");
 $mydomain = "your domain";
//


 if ($department == "delete")
   {
     echo("Selected $department<br>");
     mysql_query("update tblticketmaillog set `to` = 'deleted' where id = '$id'");
     echo("Email $id deleted");
   }
 else
   {
     if ($department)
       {
         echo("Selected $department<br>");
         mail("$department@$mydomain", "$sub", "$mess", "From: $email\n");
         echo("Sent message to $department@$mydomain from $email");
         mysql_query("update tblticketmaillog set `to` = 'sentto$department' where id = '$id'");
       }
   }
 $result = mysql_query("select * from tblticketmaillog where `to` = ''");
 while ($row = mysql_fetch_array($result))
   {
     $mess = substr($row[message], 0, 50);
     $sub = substr($row[subject], 0, 25);
     echo("<tr><td><form action=$PHP_SELF method=POST><input type=hidden name=module value=Tickets>");
     foreach ($departments as $department)
       {
         echo("<input type=radio name=department value=$department> $department");
       }
     echo("<input type=radio name=department value=delete> Delete
       <input type=hidden name=id value=$row[id]>
       <input type=hidden name=mess value=\"$row[message]\">
       <input type=hidden name=sub value=\"$row[subject]\">
       <input type=hidden name=email value=\"$row[email]\">
       <input type=submit value=\"go\"></form>
       </td><td>$row[id]</td><td>$row[email]</td><td>$sub</td><td>$mess</td></tr>");
   }
?>
</table>

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated