How can we improve WHMCS?

Share, discuss and vote for what you would like to see added to WHMCS

Forward an email to open a ticket



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.

The whole ticket system is still far too basic, buggy and clunky...

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.
-
Hello Liam,

How would you go about adding that hook to WHMCS?

Thanks
This can be done via a hook. This hook should work

<?

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();

}

}
}
@Liam, have you thought about creating the hook, testing and putting up a link to download?
Getting this error

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
I get a ton of requests sent directly to me, really need this feature, otherwise I have to open a ticket manually
Struggling with this for years! Its so hard to get a user to open a ticket. They think emailing one of directly is faster when in fact a ticket is much faster.
How does this only have 13 votes? To me this is a critical addon!
yup I've tried this a few times in the past just expecting it to work. We need this.
Good feature to implement!
This is a must.
How is this any different than Support Ticket Departments/Mail Import? This already works? We set up an special inbox for emails to be turned into tickets. I simply use an email client program (yes Thunderbird, Outlook, etc.) to drag/drop my email in there. WHMCS then picks up the email from the inbox via POP protocol, turns it into a ticket, and deletes the email.