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">
<textarea id="Body" name="Body" rows="1" cols="$Config{"Ticket::Frontend::TextAreaEmail"}" >
                  $Data{"ResponseFormat"}
         </textarea>
 </div>

7. inside the fuction Start(), insert this line:
 // Copy the content form the hidden texatarea into the RTE area
document.getElementById('edit').contentWindow.document.body.innerHTML=document.getElementById("Body").innerHTML;


8. save
that should be that. It is more than likely my line numbers are different, hence my attachment.
9. you can normalize & tidy it as much as you like.
10. you could also remove the original textarea since its now redundant


You can now test it.
you can confirm what its doing by launching your mysql & running this query given the ticket number
select a_content_type from article where ticket_id=126;
where you can confirm its sending in text/html format.



anyway. enjoy

(oh, and my original problem actually turned out to be the most suitable format.... go figure )






Attachment: AgentTicketCompose.dtl.tar
Description: Unix tar archive

_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support orr consulting for your OTRS system?
=> http://www.otrs.com/

Reply via email to