1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Major fix for HTML emails + breaklines!

Discussion in 'Developing, APIs and extending' started by Marvin Herbold, Feb 11, 2012.

  1. Steven Tan

    Steven Tan New Member

    Hi Gary,

    I had just installed TinyMCE, and class.SWIFT_TicketPost.php. Am facing a couple of issue which I am not certain if I had set things up correctly.

    1. I sometimes cut parts of an image and/or PDF image and paste in the email body as inline images. These do not get sent out. Are there any settings that needs to be set?

    2. Breaklines do not seem to work anymore. What should I set to get it working?

    3. When a ticket gets replied, my email client used to be able to group the replies from the same tickets in the same email conversation. However, now it appears as separate emails at the email client.

    Can you help?
  2. Gary McGrath

    Gary McGrath Staff Member

    Hi Steven,

    The "rich text editor" is just that, it allows the creation of rich text, its not a HTML editor. This means you cannot insert images ( but if you could, I am not sure inline copy and paste would work ). You also cannot use breaklines due to the rich text editor ( as again, breaklines are html )

    For number 3, I don't think thats related at all to the rich text/ticket post features, can you submit a ticket at my.kayako.com about it, as I beleive I read another thread recently with the same issue, so there might be a bug there somewhere

  3. Steven Tan

    Steven Tan New Member

    Thanks Gary for the update...I have still much to learn.
  4. aqualityplace1

    aqualityplace1 New Member

    Hello - has anyone tested this with 4.52.2417 yet?
  5. Drew Keller

    Drew Keller Just one person in a world of millions.


    I actually stopped using this project Because its not being maintained with every release and only if you ask does someone actually look at making the changes.

    However Gary has added a clean HTML processor to his ticket Post features module http://forge.kayako.com/projects/ticket-post-features and I have been using this for a couple of releases now and it's working really well.

    It also gives you some other nice features like smart breadlines and message headers.
  6. aqualityplace1

    aqualityplace1 New Member

    Thanks, looking for a way of sorting out HTML breaklines.

    Other project looks good, I wonder i they can strip out the other features. Really don't need customers or staff exposing elements removed from the post, or headers
  7. Drew Keller

    Drew Keller Just one person in a world of millions.

    To remove the header link you can just remove all the code in the public function GetPostsHeader at around line 1214. Remove everything after the { on about line 1215(next like) until the } around line 1290 this way the GetPostHeader function never returns a record so does not get displayed, you could acheive the same by changing the select statement to something that never returns information.
  8. Gary McGrath

    Gary McGrath Staff Member

    Hi there,

    If you added a question to the ticket post features project, I answered there with details of how to remove the specific features.

    REMS Support likes this.
  9. Armin.Horst

    Armin.Horst Established Member

    for those who still accept the pain to use this patch in combination with TinyMCE...
    quoting from emails did not really work for me, line breaks were missing.
    I did modify function GetQuoteContents like this
        public function GetQuoteContents()
            if (!
                throw new 
    $_finalContents $this->GetProperty('contents');
    $_dispatchContents '<p>';
    $_dispatchContents .= '<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">';
    $_dispatchContents .= $_finalContents;
    $_dispatchContents .= "</blockquote>";
    works for me, feel free to use but only if you use the TinyMCE patch and this is only tested with 4.52.2417
    before you put on a production server keep in mind that this was posted by somebody with rather limited PHP skills :)

  10. jeffshead

    jeffshead Established Member

    Has anyone adapted the 'Beautiful HTML Ticket Posts' mod for v.4.59.x?

    I tried to update it but it does not work.

    I looked at Gary's 'Ticket Post Features' mod but it does not say if it will work with 4.59.x and I can't tell if Gary's mod actually fixes bad HTML like the 'Beautiful HTML Ticket Posts' mod does.

    Fixing bad HTML is a requirement for me because I have had bad code mess up the page layout of the CP.
  11. Gary McGrath

    Gary McGrath Staff Member

  12. jeffshead

    jeffshead Established Member

    Thanks for the reply, Gary.

    I'll go ahead and give it a try.

    Does your 'Ticket Post Features' mod fix bad HTML from poorly formated emails? I did not see that specifically mentioned.
  13. Gary McGrath

    Gary McGrath Staff Member

    Yes, absolutely :)

  14. jeffshead

    jeffshead Established Member

    Gary, I managed to "uninstall" Marvin's mod and install yours.

    So far, so good! However, there is extra line spacing when comparing the original email to the posts in the help desk.

    From email:

    From help desk:

    Do you know how to fix this?
  15. Gary McGrath

    Gary McGrath Staff Member

    Which version of ticket post features did you install? ( as that's an old error with double line spacing I believe )

  16. jeffshead

    jeffshead Established Member

    I installed 2.2.
  17. Gary McGrath

    Gary McGrath Staff Member

    Hi there,

    At the bottom of the file you will find some settings for php tidy, can you try changing 'bare' => true;

    If that does not work, can you attach a copy of the raw html, so I can throw it in my system and check it out

  18. jeffshead

    jeffshead Established Member

    I changed to 'bare' => true; but it did not help.

    The attached file contains the HTML of the Outlook 2010 email depicted below.

    Email that was sent:

    Help desk result:

    Attached Files:

  19. jeffshead

    jeffshead Established Member

    No one else has encountered the extra spacing?
  20. jeffshead

    jeffshead Established Member

    Using the advise of brat42, I added the following to the 'customcss' template in the Kayako Admin CP (
    .MsoNormal {
    Now the spacing is gone!

    I have not encountered any negative side effects yet but maybe there is a better way to remove the extra space.

Share This Page