How to Make Response Message Text Bolder Than The Rest of The Message in the Response Email of osTicket v1.6 RC5
Have you ever wanted to make the response message text become bolder in the response email in your osTicket System so that your client will be easier to differs and read it from the other message in that email? Since the default of email template in osTicket using the plain text, then we have to change the type of the message that located in the class.email.php file, from the text mode to the html mode. This modification also will answer the same question in osTicket Discussion Forum as well. Okay, here is the solution I successfully made.
-
Open your \include\class.msgtpl.php file, and find this code:
144
',ticket_reply_body='.db_input(Format::striptags($var['ticket_reply_body'])).
then replace with this following code:
144
',ticket_reply_body='.db_input($var['ticket_reply_body']).
Find again this code:
209
',ticket_reply_subj='.db_input(Format::striptags($info['ticket_reply_subj'])).
then replace with this following code:
209
',ticket_reply_subj='.db_input($info['ticket_reply_subj']).
-
Open your \include\class.email.php file, and find this code:
160
$body = stripslashes(preg_replace("/(\r\n|\r)/s", "\n", trim($message)));
then replace with this following code:
160 161
//$body = stripslashes(preg_replace("/(\r\n|\r)/s", "\n", trim($message))); // Text mode $body = stripslashes(preg_replace("/(\r\n|\r)/s", "<br />", trim($message))); // HTML mode
Find again this code:
203
$mime->setTXTBody($body);
then replace with this following code:
203 204
//$mime->setTXTBody($body); // switch to HTML mode below $mime->setHTMLBody($body);
-
Go to your Admin Panel -> Emails -> Templates -> then click on your template record (default: osTicket Default Template), then at the Message Body directive under the Ticket Response/Reply section, change this code:
%response
become:
<b>%response</b>
Please note that since we have switched from the text mode to the html mode, then we have to change also this URL code at the same template place above in order to have the ability to be clicked, from this code:
%url/view.php?e=%email&t=%ticket
become this following code:
<a href="%url/view.php?e=%email&t=%ticket">%url/view.php?e=%email&t=%ticket</a>
afterwards, click on the Save Changes button to save the changes.
Now, each time your staff reply to a ticket, then the response message in the email that your client received will become bolder than the rest of the messages.
Please note that by using that technique above, you can also implement this html mode for other section in your email template in Admin Panel.
Have a nice try!
Print This Post



I followed this tutorial for my RC5 and my output e-mail looks like this
Person,A request for support has been created and assigned ticket #757947. A representative will follow-up with you as soon as possible.You can view this ticket’s progress online here: http:/websiteaddress.com/support/view.php?e=emailaddress@email.com&t=757947.If you wish to send additional comments or information regarding this issue, please don’t open a new ticket. Simply login using the link above and update the ticket.websiteaddress.com.com admnimistrator
I changed the personal info above, but it strips everything down to one line and is not bold.
here are my changes
/support/include/msgtpl.php
/support/include/class.email.php
There are 2 entries of step 2 part 1. I replaced both instances. 1 instance is in the “send” function and another in “sendmail” function. In my settings i have SMTP as outgoing.
instance 1
instance 2
step 2 part 2
E-mail template is
Thanks for the up and coming support, and these tutorials are gold.
looks like I cant paste in the e-mail template without this site changing it, but basically I followed your steps for it
Tyler,
I think you have missed the step that you called with instance 2 above.
Yours is:
whereas it should be:
In the other words, you missed the <br /> tag which has function to break the line to the next line.
Masino, the instance 2 suggestion you had was already implemented in my code, I guess it was just a bad typo on my part on the post. The Results are still the same as my original post. Im just going to revert back and wait for others feedback because I know im doing it right.
Tyler,
I have re-tested that modification above and there is nothing left. Also, the response email that received by client also worked properly; the response message text was bold as well.