- Edited
I like osTickets but I don't like the way it handles displaying HTML tickets, it seems to destroy them. For my shopping cart I wanted the "contact us" to be sent to osTickets so we could keep track of them. Unfortunately it only sent the contact email in HTML. So Here is my hack to have HTML emails formatted into plain text properly.
This works much better than what comes stock. I have attached two images. One is of an HTML email from my "Contact Us" form and the second is the "Contact Us" form in osTicket using html2text to parse the email.
P.S. Remember I am systems administrator not a programmer by trade so any tips will be greatly appreciated.
Download html2text.php from (http://www.howtocreate.co.uk/php/html2texthowto.html) and save it in the "include" directory.
include/class.format.php
Add...
require('html2text.php');
Above...
class Format {
Replace...
function striptags($string) {
return strip_tags(html_entity_decode($string)); //strip all tags ...no mercy!
}
With...
function striptags($string) {
$string = <USERMENTION username="html2text">@html2text</USERMENTION>($string);
return strip_tags($string);
}
include/class.ticket.php
Replace...
',message='.db_input(Format:($msg)). //Tags/code stripped...meaning client can not send in code..etc
With...
',message='.db_input($msg).
Replace...
',response='.db_input(Format:($response)).
With...
',response='.db_input($response).