Hi,
I spent time parsing the forum, and Google as well, to find a way to solve my problem, but I didn't find any answer.
I would like to send different type of mails depending on categories, with different templates : one template for support, another for contact...
I was considering to install several instances of Hesk (one per categoy), linked to the same database, but it doesn't seem to be the right way.
I thought there should be a variable which points to the mail folder I could modify depending on the category to point to another mail folder related to the category...
So, is there a simple way to do it or am I completely in a wrong way.
If someone has an idea, I will appreciate.
Thanks for help.
Greetings from Paris (France)
Jean-François
Mails to customers depending on categories
Moderator: mkoch227
Re: Mails to customers depending on categories
Probably the fastest and easiest way would be to simply modify the function that retrieves email message.
For example:
1. create multiple copies of the "emails" folder (each with all the templates): emails, email_sales, emails_support, ...
2. in file inc/email_functions.inc.php replace this line:
With something like:
So if the ticket was from category with ID 1, emails would be taken from folder "language/en/emails_support", if ticket was from ID 2 they would be from "language/en/emails_sales", ... and by default from the original "emails" folder.
It may not be the most convenient one, but it's a quick hack that doesn't require much coding.
For example:
1. create multiple copies of the "emails" folder (each with all the templates): emails, email_sales, emails_support, ...
2. in file inc/email_functions.inc.php replace this line:
Code: Select all
$eml_file = 'language/' . $hesk_settings['languages'][$hesk_settings['language']]['folder'] . '/emails/' . $eml_file . '.txt';
Code: Select all
switch ($ticket['category'])
{
case 1:
$folder = 'emails_support';
break;
case 2:
$folder = 'emails_sales';
break;
// More cases here...
default:
$folder = 'emails';
}
$eml_file = 'language/' . $hesk_settings['languages'][$hesk_settings['language']]['folder'] . '/'.$folder.'/' . $eml_file . '.txt';
It may not be the most convenient one, but it's a quick hack that doesn't require much coding.
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: Mails to customers depending on categories
Hello Klemen,
Thanks for your answer which looks better than mine (far much easy to understand).
It is very close of what I did.
I wanted to stay category independant, so I choose to use an index instead of putting the folder name in the code, using "emails"."n" folder instead.
It was quick and dirty (probably much more dirty than quick)
As I don't know how many categories I have to manage, my next step will be to pick-up the information from the database and handle the folder names. I'm not sure it will be usefull but anyway I will try.
It will probably help to avoid the error message I'm facing when running hesk_pop3.php
"another Pop3 fetching..." ,"Une autre tâche de remplissage POP3 est en cours."
Jean-François
Thanks for your answer which looks better than mine (far much easy to understand).
It is very close of what I did.
I wanted to stay category independant, so I choose to use an index instead of putting the folder name in the code, using "emails"."n" folder instead.
Code: Select all
$tempdir='/emails'.strval($ticket['category']);
$eml_file = 'language/' . $hesk_settings['languages'][$hesk_settings['language']]['folder'] . $tempdir.'/' . $eml_file . '.txt';
As I don't know how many categories I have to manage, my next step will be to pick-up the information from the database and handle the folder names. I'm not sure it will be usefull but anyway I will try.
It will probably help to avoid the error message I'm facing when running hesk_pop3.php
"another Pop3 fetching..." ,"Une autre tâche de remplissage POP3 est en cours."
Jean-François