Many of the large ticketing systems (Zendesk, SupportPal, FreshDesk, etc.) allow the ability for an administrator/ticket operator to forward an email they receive in their personal mailbox to the ticketing system, and it will open the ticket "On Behalf" of the user who emailed them. I would like to see this ability in WHMCS for both existing and new customers who may email a staff member directly, instead of using the ticketing system.
This should take the forwarded email and open a new ticket, stripping out the "FWD" information and extracting the "from" email address, just as the other guys do.
12 Comments
Login to post a comment.
If I forward tickets into whmcs, I have to choose a different FROM address when forwarding, since you cannot use your own user, or it's ignored.
I then have to go into the ticket system and assign that ticket to the client.
But even though I have changed the owner of the ticket, my email address is still linked to it somehow, even though it doesn't appear anywhere in the ticket options.
So I then end up getting copies of all replies cc'd to me.
there is not even an ability to open a ticket on behalf of a ticket.
If I create a ticket under a client's account, it shows as coming from me and not them.
plus you STILL do not have any ability to assign a ticket to a specific user or contact.
These are things people have been asking for since I first started using WHMCS 15+ years ago.
-
How would you go about adding that hook to WHMCS?
Thanks
<?
add_hook("TicketPiping",1,"fwd_ticket_pipe");
if(!function_exists("fwd_ticket_pipe"))
{
function fwd_ticket_pipe($vars)
{
$to = $vars['to'];
$subject = $vars['subject'];
if (strpos($subject, 'Fwd:') !== false) {
$adminonly = false; // For admin only
if($numrows > 0)
{
$adminonly = true;
}
$subject = str_replace("Fwd: ", "", $vars['subject']);
$lines = explode("\n", $vars['body']);
$message = '';
for ($i=0; $i < count($lines); $i++) {
$lines[$i] = str_replace("> ","",$lines[$i]);
//Split out the sender information portion
if (preg_match("/From: (.*)<(.*)>/", $lines[$i], $matches)) {
$name = $matches[1];
$email = $matches[2];
} else {
}
if($i > 8)
{
$message .= $lines[$i].'
';
}
}
if($adminonly)
{
$numrows2 = Illuminate\Database\Capsule\Manager::table("tbladmins")->where("email","=",$vars['email'])->count();
if($numrows2 > 0)
{
logActivity('Forwarded email is sent from an admin email account. It has been imported', 0);
processPipedTicket($to, $name, $email, $subject, $message, $vars['attachments']);
} else {
logActivity('Forwarded email is not sent from an admin email account. It has NOT been imported', 0);
}
} else {
logActivity('Forwarded email is sent from a generic email account. It has been imported', 0);
processPipedTicket($to, $name, $email, $subject, $message, $vars['attachments']);
}
exit();
}
}
}
ArgumentCountError: Too few arguments to function processPipedTicket(), 6 passed in /home/xxxx/public_html/clientzone/includes/hooks/emailforward.php on line 57 and at least 7 expected in /home/xxxx/public_html/clientzone/includes/ticketfunctions.php:0