Re: html is being stripped out

As promised here are the notes on how i switched otrs from plain/text to html emails. these are pretty much from memory, so i'm not expecting any awards for style. This configuration is the best solution for our needs & can be tweaked further (this setup sends html, accepts html, but will still strip the original html from outgoing reply messages (if you choose to ReplyWithContent)). While on the QueueView it will only say, this is an html message & wont show the content (there is a link that you can choose to show the content in a popup) this setup is the easiest to maintain, so its what i documented) if you wanted you could force it to show the message, but its not really worth it in our case. on each of your responses/autoresponses you can add <html><body><pre> --your templated response-- </pre></body></html>. you can also change your default compose content: sysconfig-> Ticket -> Frontend::Agent::Ticket::ViewCompose Disable the AutoHTML2Text: Config Options: sysconfig -> Ticket -> Core::PostMaster Switch from plain text to text/html Kernel/Modules/AgentTicketCompose.pm around line 563 (section: # send email) & change it to: Type => 'text/html', Kernel/System/Ticket/Article.pm around line 2002 (section: # send email) & change it to: Type => 'text/html', (if you run a find|grep for "text/plain" from /Kernel you will see there are plenty of further areas for conversion, but this is all thats needed for our needs) Now when you attempt to compose an answer the default otrs textarea is kinda naff if you want to write html. So you can follow my example & hide the textarea & instead use a RichTextEditor eg. http://www.mozilla.org/editor/midasdemo/ (i have attached my current Composer code. This works on mozilla & should work on ie. with no mods) also this can also be impoved greatly, but its is a very simple setup & easily reversable) essentially: 1. get the midas code 2. edit Kernel/Output/HTML/Standard/AgentTicketCompose.dtl 3. inside function submit_compose() stick this: // Swap the richtext content back into the otrs textarea document.getElementById("Body").value=document.getElementById("edit").contentWindow.document.body.innerHTML; 4. inside fuction SpellCheckSubmit() change it to spellecheck the RichTextArea: //document.spelling.Body.value = document.compose.Body.value; document.spelling.Body.value = document.getElementById("edit").contentWindow.document.body.innerHTML; 5. Around line 150 stick in the midas code (you want to paste it just after these 2 lines) <td class="contentkey">$Text{"Text"}:</td> <td class="contentvalue" valign="top"> <!-- midas code here --> 6. Wrap the original textarea in a hidden box (you can do this last so you can test the rte contains the right content) <div style="visibility:hidden;height:0">
participants (1)
-
Stephen Gebbie