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. tallen-bt

    tallen-bt Established Member

    I haven't had the error since using Gary's version.
  2. Marvin Herbold

    Marvin Herbold Established Member

    Sorry, I just noticed this post - the fix for this is really easy. Basically the issue is with Microsoft Office and how they expect the <p> tag to be handled... they do not want margins around the <p> block which is not the default HTML behavior. The fix is to edit the __swift\themes\admin_default\css.tpl file and add the following to the very top of the file:

    .MsoNormal, .MsoPlainText, .MsoAutoSig {
        MARGIN: 0;
    Then save and go to your Admin CP and do the Rebuild Cache (under Diagnostics) and voila!
  3. tallen-bt

    tallen-bt Established Member

    @Marvin, they were also using the TinyMCE patch which originally Kayako had it use a <p> tag giving the behavior they mentioned with the line spacing. If you change the TinyMCE config to use <br> instead then behavior returns to more expected behavior.

    Now that I think about it, <p> is more ideal to <br> and thus your css fix is more inline than merely having TinyMCE switch to <br>'s in the first place.
  4. erebus

    erebus New Member

    I get this error happens when the first post in a ticket is empty (or edited? not quite sure) under .1148 using the latest Gary's file. Any ideas???

    [Notice]: Trying to get property of non-object (Ticket/class.SWIFT_TicketPost.php:865)
    [Warning]: Invalid argument supplied for foreach() (Ticket/class.SWIFT_TicketPost.php:865)
  5. tallen-bt

    tallen-bt Established Member

    Anyone have an updated copy for 4.50.00?
  6. Gary McGrath

    Gary McGrath Staff Member

    There has been a mass of changes to the whole structure of kayako, I have attempted to have a quick go at updating marvins code, absolutely no warrenty, this may or may not work, so make sure to backup your system before even thinking of trying it.

    Also note, the location of the actual file has changed too: \__apps\tickets\models\Ticket


    Attached Files:

  7. masterctrl1

    masterctrl1 Kayako Guru

    The title of this post is "Major fix for HTML emails + breaklines!".
    Are you saying none of Marvin's suggested code fixes ended up in 4.50.00?
  8. tallen-bt

    tallen-bt Established Member

    This is for his add-on and is not a part of the base code.

    EDIT: File looks good Gary. Just need to get the breaklines part back into it.
  9. tallen-bt

    tallen-bt Established Member

    Would have to agree to this... his code is a huge improvement to the look of HTML parsed tickets.
  10. Gary McGrath

    Gary McGrath Staff Member

    Hi there,

    Since Marvin is not around much, I am just trying to help the community in getting this mod to work, but I want to make it clear that I am doing that as myself and not as kayako. This mod will not be used by kayako, the long game with kayako is to get html purifier working stable, which will result in very nice looking posts, but the issue is its currently very resource intensive and not great for larger helpdesks

  11. tallen-bt

    tallen-bt Established Member

    Was there any ETA on that? Even to allow us to patch ourselves and test?
  12. Gary McGrath

    Gary McGrath Staff Member

    Not at the moment I am afraid, but I will see if anything can be done to bridge the gap in the meantime, no promises though

  13. tallen-bt

    tallen-bt Established Member

    Thanks Gary,

    Would be happy to test anything I can, not sure what is considered a large help desk.

    In the mean time we have to use the file you posted above in order to keep the incoming ticket views clean and readable (Still some large space issues but overall a HUGE improvement) but unfortunately we don't have the breaklines part in so we get some very long posts.
  14. Shaun Poland

    Shaun Poland New Member

  15. Armin.Horst

    Armin.Horst Established Member

    had the same problem, using the tinyMCE-Patch when entering a reply and did not hit enter at the end,
    (I believe) I fixed the problem by modifying class.Controller_Ticket.php, in ReplySubmit-Function I'm adding a "br" to the HTML-Content, the errors sounded to me like it is missing a trailing tag?

            if ($this->Settings->Get('t_tinymceeditor') == '1' && isset($_POST['replycontents_htmlcontents']) && $_POST['replycontents_htmlcontents'] != '') {
    $_replyContents $_POST['replycontents_htmlcontents'] . "<br>";
    $_isHTML true;
    quick&dirty hack, worst case I might have an additional line break before the signature...

  16. Patrick Stel

    Patrick Stel Established Member

    @Armin.Horst what version of Kayako are you using?
    Cause I'm still working to get tinymce working in our staff panel.

    So if you're using v4.50 please let me know what changes you made to the core files.

  17. Armin.Horst

    Armin.Horst Established Member

    I'm using 4.40.1148

    I was looking into 4.50, but my PHP skills are too limited to sync the 4.40 patches into 4.50. merging into 4.40 was already a challenge for me.
    And a working rich text editor is a mandatory requirement for us.

    I still hope/expect that Kayako will deliver a rich text editor integration, SWIFT-209 is in "awaiting audit" status ( ... since a while ... ), Jamie Edwards responded in the "4.50 release note"-thread that it is still not in the release and there was no further response in the forum when I asked for a timeline

  18. Patrick Stel

    Patrick Stel Established Member

    Hmm okay, then I will continue on modifying the code and try to implement the tinymce editor
  19. Armin.Horst

    Armin.Horst Established Member

    Hi Patrick
    any luck so far? Unfortunately I can't help for the coding, but I can offer my help for testing.

    I did face another issue yesterday with quoting emails. When quoting in 4.40 there are line-breaks missing and there is a patch described in SWIFT-1499. This seems only to work without tinymce. of course I could add
    instead of CRLF, but while the Reply is using tinyMCE, the forward is using the standard edit without rich text and I haven't figured out yet how to distinguish between being called from "reply" or from "forward"

  20. Patrick Stel

    Patrick Stel Established Member

    Hey Armin,

    I'm not lucky at the moment still haven't got TinyMCE working for staff

Share This Page