Page 1 of 1

Print message

Posted: Thu Dec 04, 2008 6:57 pm
by kevin222
Hi,

I have question regarding how to print "Message" in the Staff email?

currently i have
Ticket subject: %%SUBJECT%%
Tracking ID: %%TRACK_ID%%

So, what's the symbol for message? %%??????%%%


Thanks.

Posted: Fri Dec 05, 2008 12:44 am
by Sammy95
As far as I can see there is no code in the original script for adding the body of the message into the email.

However You can add it Yourselves if You like to. But You will then have to edit the sourcecode.

But it has a disadvantage: When You upgrade to a new version it will go away or You will have to edit the new files again as well.

You will have to edit the file submit_ticket.php
Just use an ordinary editor. write.exe (winwrite) in Windows (not Word) will do.

(If the file looks the same when You open it, save it, close it, and open it again - the editor usually works.)

(BUT: Keep a copy of the file in case You mess it up)

Add the following on line 64:

Code: Select all

$message2 = $message;
It should then look like this:

Code: Select all

$message=hesk_input($_POST['message']) or $hesk_error_buffer[]=$hesklang['enter_message'];
$message2 = $message;


/* Custom fields */
if ($hesk_settings['use_custom']) {

Then around line 166 add this line:

Code: Select all

$message=str_replace('%%TEXT%%',$message2,$message);
It should then look like this:

Code: Select all

fclose($fp);

$message=str_replace('%%TEXT%%',$message2,$message);
$message=str_replace('%%NAME%%',$name,$message);

The same thing around line 203, add the same line:

Code: Select all

$message=str_replace('%%TEXT%%',$message2,$message);
It should then look like this:

Code: Select all

fclose($fp);

$message=str_replace('%%TEXT%%',$message2,$message);
$message=str_replace('%%NAME%%',$name,$message);

We are now finished with PHP editing.. Save and upload the files to your website.

Now add %%TEXT%% in Your Email textfiles where You want to insert the message body. I guess You know how to do it..

But remember You have to do this on all new upgrades that will arrive.
So keep a copy of this message in Your script folder as well..

Remember: I am absolutely not a php pro - this was just my hack to do this. Use it on your own risk. It worked fine on my site.

Edit: I use version 0.94.1

Sammy :)

Posted: Fri Dec 05, 2008 7:05 am
by kevin222
It works! thanks for your genrous help