Email piping not allowing multiple emails or CC
Moderator: mkoch227
Email piping not allowing multiple emails or CC
Script URL: lan
Version of script: 2.4.2
Hosting company: lan
URL of phpinfo.php: na
URL of session_test.php: na
What terms did you try when SEARCHING for a solution: multiple address, cc, carbon copy
Write your message below:
Sorry for yet another question, but this one might actually be the last one. I am using email piping and it is working great, however, when a customer sends an email to our ticketing system and they have multiple emails on the line and ones on CC, none of them are being added to the email.
The reason for this, is that numerous customers will send us support requests, and put other people in copy on the request.
Can you suggest how I could go about adding this functionality?
Thanks so much.
Version of script: 2.4.2
Hosting company: lan
URL of phpinfo.php: na
URL of session_test.php: na
What terms did you try when SEARCHING for a solution: multiple address, cc, carbon copy
Write your message below:
Sorry for yet another question, but this one might actually be the last one. I am using email piping and it is working great, however, when a customer sends an email to our ticketing system and they have multiple emails on the line and ones on CC, none of them are being added to the email.
The reason for this, is that numerous customers will send us support requests, and put other people in copy on the request.
Can you suggest how I could go about adding this functionality?
Thanks so much.
Re: Email piping not allowing multiple emails or CC
I'm afraid this would require several changes to the code and the way HESK behaves.
I plan to add such functionality to HESK (don't ask when
), but if you need in sooner than officially released I'm afraid you will need to hire a developer to help you out as customizations of such extent are out of the scope of my support.
I plan to add such functionality to HESK (don't ask when

Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 2
- Joined: Thu Apr 11, 2013 12:54 pm
Re: Email piping not allowing multiple emails or CC
Hi everyone!
I have made this customization to my Hesk and... well... it works. Actually, sometimes Hesk is opening a new ticket on replies. I'm still working on it and soon that I trace the problem I'll post here the solution.
To add this functionality the Hesk you have to edit file "/inc/pipe_functions.inc.php". Copy and paste the code between "STARTS HERE" and "ENDS HERE" to the function hesk_email2ticket.
I hope I've helped.
-- EDIT
I forgot to say this customization just works to the field CC.
I have made this customization to my Hesk and... well... it works. Actually, sometimes Hesk is opening a new ticket on replies. I'm still working on it and soon that I trace the problem I'll post here the solution.
To add this functionality the Hesk you have to edit file "/inc/pipe_functions.inc.php". Copy and paste the code between "STARTS HERE" and "ENDS HERE" to the function hesk_email2ticket.
Code: Select all
function hesk_email2ticket($results, $pop3 = 0)
{
global $hesk_settings, $hesklang, $hesk_db_link, $ticket;
// Process "From:" email
$tmpvar['email'] = hesk_validateEmail($results['from'][0]['address'],'ERR',0);
// "From:" email missing or invalid?
if ( ! $tmpvar['email'] )
{
return NULL;
}
### CUSTOMIZATION STARTS HERE ###
// Processa o campo "Cc:"
foreach ($results['cc'] as $c => $cc)
{
// verifica se o campo é válido
$tmpvar['cc'] = hesk_validateEmail($cc['address'],'ERR',0);
// Se o campo "Cc" foi preenchido adiciona no campo de emails
if ( $tmpvar['cc'] )
{
$tmpvar['email'] = $tmpvar['email'] . ',' . $tmpvar['cc'];
}
}
### CUSTOMIZATION ENDS HERE ###
// Process "From:" name, set to "[Customer]" if not set
$tmpvar['name'] = hesk_input($results['from'][0]['name']) or $tmpvar['name'] = $hesklang['pde'];
// Process "To:" email (not yet implemented, for future use)
// $tmpvar['to_email'] = hesk_validateEmail($results['to'][0]['address'],'ERR',0);
-- EDIT
I forgot to say this customization just works to the field CC.

---
Alessandro D. R. Fazenda
Alessandro D. R. Fazenda
Re: Email piping not allowing multiple emails or CC
Thanks for sharing!
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 2
- Joined: Thu Apr 11, 2013 12:54 pm
Re: Email piping not allowing multiple emails or CC
Hi everyone!
I've made an improvement to the email parser.
My beloved users started to send tickets using the Hesk email address on CC: field and putting anyone else on TO: field. Result: some (important) people were missing to receive tickets solutions.
With this improvement users can use both CC: and TO: fields to open tickets and everybody will receive the solution.
It's the same file "/inc/pipe_functions.inc.php" and the same function hesk_email2ticket from my another post. Copy and paste the code between "STARTS HERE" and "ENDS HERE" and replace the other code.
Cheers
I've made an improvement to the email parser.
My beloved users started to send tickets using the Hesk email address on CC: field and putting anyone else on TO: field. Result: some (important) people were missing to receive tickets solutions.
With this improvement users can use both CC: and TO: fields to open tickets and everybody will receive the solution.
It's the same file "/inc/pipe_functions.inc.php" and the same function hesk_email2ticket from my another post. Copy and paste the code between "STARTS HERE" and "ENDS HERE" and replace the other code.
Code: Select all
function hesk_email2ticket($results, $pop3 = 0)
{
global $hesk_settings, $hesklang, $hesk_db_link, $ticket;
// Process "From:" email
$tmpvar['email'] = hesk_validateEmail($results['from'][0]['address'],'ERR',0);
// "From:" email missing or invalid?
if ( ! $tmpvar['email'] )
{
return NULL;
}
### CUSTOMIZATION STARTS HERE ###
// Processa o campo "Cc:"
foreach ($results['cc'] as $c => $cc)
{
// verifica se o campo é válido
$tmpvar['cc'] = hesk_validateEmail($cc['address'],'ERR',0);
// Se o campo "Cc" foi preenchido (e não é o proprio endereço do Hesk) adiciona no campo de emails
if ( $tmpvar['cc'] && $tmpvar['cc'] != $hesk_settings['support_mail'] )
{
$tmpvar['email'] = $tmpvar['email'] . ',' . $tmpvar['cc'];
}
}
// Processa o campo To:"
foreach ($results['to'] as $t => $tt)
{
// verifica se o campo é válido
$tmpvar['to_email'] = hesk_validateEmail($tt['address'],'ERR',0);
// Se o campo "To" foi preenchido (e não é o proprio endereço do Hesk) adiciona no campo de emails
if ( $tmpvar['to_email'] && $tmpvar['to_email'] != $hesk_settings['support_mail'] )
{
$tmpvar['email'] = $tmpvar['email'] . ',' . $tmpvar['to_email'];
}
}
### CUSTOMIZATION ENDS HERE ###
// Process "From:" name, set to "[Customer]" if not set
$tmpvar['name'] = hesk_input($results['from'][0]['name']) or $tmpvar['name'] = $hesklang['pde'];
// Process email subject, convert to UTF-8 if needed, set to "[Piped email]" if none set
$tmpvar['subject'] = $results['subject'];
if ( ! empty($results['subject_encoding']) && strtoupper($results['subject_encoding']) != 'UTF-8' )
{
$tmpvar['subject'] = iconv($results['subject_encoding'], 'UTF-8', $tmpvar['subject']);
}
$tmpvar['subject'] = hesk_input($tmpvar['subject'],'','',1) or $tmpvar['subject'] = $hesklang['pem'];
---
Alessandro D. R. Fazenda
Alessandro D. R. Fazenda
Re: Email piping not allowing multiple emails or CC
Thanks for sharing!
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Email piping not allowing multiple emails or CC
Yikes! I used your code and nearly crashed my server! Likely it's because it added the piping email address to the email field - and that created an infinite loop of email confirmations!
Does anyone know how to tweak the above code so it doesn't add the piping email address???
Thanks!
Lisa
Does anyone know how to tweak the above code so it doesn't add the piping email address???
Thanks!
Lisa
- Lisa
Re: Email piping not allowing multiple emails or CC
Haven't used or tested any of the above code, but you will probably need something like each place where an email could be added to the $tmpvar['email']
Code: Select all
(EMAIL VARIABLE) != 'your@pipedmail.com'
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Email piping not allowing multiple emails or CC
Thx for sharing, I´ve found a solution, same file as descrived above (just replace xxx@support.com for your own support mail:
To avoid the creation of new ticket when some of the CC reply, just delete the following code:
cheers 
Code: Select all
// Processa o campo "Cc:"
foreach ($results['cc'] as $c => $cc)
{
// verifica se o campo é válido
$tmpvar['cc'] = hesk_validateEmail($cc['address'],'ERR',0);
// Se o campo "Cc" foi preenchido (e não é o proprio endereço do Hesk) adiciona no campo de emails
if ( $tmpvar['cc'] != 'xxx@support.com' )
{
$tmpvar['email'] = $tmpvar['email'] . ',' . $tmpvar['cc'];
}
}
// Processa o campo To:"
foreach ($results['to'] as $t => $tt)
{
// verifica se o campo é válido
$tmpvar['to_email'] = hesk_validateEmail($tt['address'],'ERR',0);
// Se o campo "To" foi preenchido (e não é o proprio endereço do Hesk) adiciona no campo de emails
if ( $tmpvar['to_email'] != 'xxx@support.com' )
{
$tmpvar['email'] = $tmpvar['email'] . ',' . $tmpvar['to_email'];
}
}
Code: Select all
// Do email addresses match?
if ( strpos( strtolower($ticket['email']), strtolower($tmpvar['email']) ) === false )
{
$tmpvar['trackid'] = '';
}

Re: Email piping not allowing multiple emails or CC
Cool, thank you!
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools