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. Drew Keller

    Drew Keller Just one person in a world of millions.

    Marvin,

    I tried your mod and I have an issue that line breaks seem to be missing, below is an example (just a HTML email signature from outlook 2010), I have only just tried it from version 1.02.

    Test Drew KellerSenior Systems Engineer hs.com.au/">endif]>Top Hat TechsMobile: XXXXXXXXXXX
    Email: XXXXXX@tophattechs.com.au
    Web: www.tophattechs.com.au DisclaimerThe information in this message is confidential and may be privileged or subject to copyright. It is intended solely for the use of the intended addressee(s).The unauthorised use of the information may result in liability for breach of confidentiality, privilege or copyright. If you have received this message in error, please notify the sender immediately by reply email and delete the message and any attached files

    from

    Test

    Drew Keller
    Senior Systems Engineer
    Top Hat Techs

    Mobile: XXXXXXXXXXX Email: XXXXXXXX@tophattechs.com.au

    Web: www.tophattechs.com.au

    Disclaimer
    The information in this message is confidential and may be privileged or subject to copyright. It is intended solely for the use of the intended addressee(s).
    The unauthorised use of the information may result in liability for breach of confidentiality, privilege or copyright. If you have received this message in error, please notify the sender immediately by reply email and delete the message and any attached files
     
  2. Marvin Herbold

    Marvin Herbold Established Member

    I'll be more than happy to fix this for you (because we would benefit from the fix too) - but I would need the source HTML to see what is going on. In Kayako go into the Admin CP and go into the mail parser log and find that email that is having the issue - and copy / paste the raw contents of the email and send it to mherbold at ainterpreting.com - OR you can click on "edit" on the ticket post and copy / paste the HTML into an email to me.
     
  3. tallen-bt

    tallen-bt Established Member

    I get a difference set of code... re_x0020_0">dif]> appears near the end of some of the replies. Will send you an email shortly.
     
  4. Marvin Herbold

    Marvin Herbold Established Member

    Just fixed it - download version 1.03 for the fix. The issue was with it not knowing how to handle tags that looks like <![ ... ]>
     
  5. Drew Keller

    Drew Keller Just one person in a world of millions.

    Marvin,

    Just tried 1.3 and it got rid of the code within teh text, but the text still seems to be missing all the linefeeds.

    I will send you some samples from the parser log.
     
  6. tallen-bt

    tallen-bt Established Member

    We keep having an issue where if we process emails as HTML, they periodically will get completely stuck in the queue without any errors of any kind until we switch back to processing as text. :(
     
  7. Drew Keller

    Drew Keller Just one person in a world of millions.

    Marvin,

    Have you had a chance to look at this for 4.40.954 (959)?

    I notice when I have it in place the edit tab no longer works, so I am guessing there has been a change to the code. And my PPH is not strong enough (on next no non existent) to be able to see the cause.

    I really liked the HTML parsing but looks like I am back to TEXT :(.
     
  8. Marvin Herbold

    Marvin Herbold Established Member

    We are still on 833 and do not have any plans to upgrade anytime soon. :(
     
  9. Drew Keller

    Drew Keller Just one person in a world of millions.

    Ok No problems.

    I only took the upgrade because Kayako told me to to try and fix another issue which they then said oh no its a bug. Guess I am going to have to learn PHP. LOL
     
  10. Marvin Herbold

    Marvin Herbold Established Member

    If you still have the original 833 code, download Beyond Compare and run it on the 833 files (the original and my version) and you'll see exactly what changes I made to the file. Then you should be able to incorporate my changes into the 959 version of the same file.
     
  11. Drew Keller

    Drew Keller Just one person in a world of millions.

    Marvin.

    Thanks, I didn't have the original but I used winmerge (because thats the tool I had installed) and I weas able to identify your changes vs Kayako 959 fixes and have been able to successfully impliment it and everything is back working.

    Next upgrade I will have to remember not to just replace the file without looking my bad. LOL

    but for anyone else here is my updated file. (Marvin I am happy if you want to have a look and them upload to your project under forge so its ready for all users on 954 or 959.)
     

    Attached Files:

  12. Marvin Herbold

    Marvin Herbold Established Member

    I just updated the beautiful html emails code to version 1.04 to include my latestest new feature - HTML breaklines. This completely replaces Kayako's default breaklines processing (which is plain string matching and regex pattern matching, neither suitable for html!)... however it is a little bit involved to "turn on" this feature if you want it, but I have explained everything on Forge.
     
  13. Gary McGrath

    Gary McGrath Staff Member

    Hi Marvin,

    RE updating, if you missed it, this is the update info here: http://wiki.kayako.com/display/DOCS/4.40.959

    There are some nice features which were added, like universal search for client front end ( something our clients have been screaming for ), the ticket notifications are also smarter, as in, if you assign a ticket to yourself, it now knows not to email you about it for example. The reports beta added new features too, you might wanna check out if any of the new features are handy/needed in your case :)

    Gary
     
  14. Marvin Herbold

    Marvin Herbold Established Member

    Hi Gary - yeah I saw that information and didn't really see anything we can use to make it worth updating - we don't use the web front end at all and have all notifications and automatic re-emailing shut off. We aren't using any of the reporting features either (yet!)... so at this point the effort to migrate all my code changes (and there are quite a few!) to 959 and the risk of running into some new bug isn't worth it, as at this point our helpdesk is running great for us. One thing that might force us to upgrade is the iPhone app support... there may be something in 959 that fixes bugs for the iPhone app support... but of course since the iPhone app isn't out yet (I look every day!) we're in a wait and see mode.
     
  15. Gary McGrath

    Gary McGrath Staff Member

    Hi Marvin,

    We use the iphone app ( we were in the beta test ), if your running on 833 now, there is no changes in 959 in regards to iphone app, its working spot on with 833, you will really like it once you get your hands on it, should be any day now for major release, just waiting for apple to approve it.

    Gary
     
  16. tallen-bt

    tallen-bt Established Member

    Has anyone tested this with 959?
     
  17. Marvin Herbold

    Marvin Herbold Established Member

    @tallen-bt - Look for a post a few steps above yours - Drew Killer made a 959 version - I haven't looked at it or tested it yet.
     
  18. Marvin Herbold

    Marvin Herbold Established Member

    @tallen-bt - Never mind - I just downloaded Drew Keller's file and updated it to the latest code I have. I don't run version 959 so I can't test it, but I did go ahead and put it up in Forge. I changed all the version numbers in the Forge project so that it is now simply v1, v2, v3, v4, etc followed by a - 833 or -959 to indicate which version of Kayako it's for. The latest version as of this post is v5 - 833 and v5 - 959. I hope this helps! Please reply to this post and let me know if it works with your 959 install of Kayako.
     
  19. tallen-bt

    tallen-bt Established Member

    I made all the modifications, waiting for some emails to see how everything goes.

    Seems to work, however the following test didn't pull out the 'From', etc lines...
    HTML:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
    </head>
    <body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
    <div>Replying!!!!</div>
    <div><br>
    </div>
    <span id="OLK_SRC_BODY_SECTION">
    <div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
    <span style="font-weight:bold">From: </span>Trevor Allen &lt;<a href="mailto:test@test">test@test</a>&gt;<br>
    <span style="font-weight:bold">Reply-To: </span>Trevor Allen &lt;<a href="test@test">test@test</a>&gt;<br>
    <span style="font-weight:bold">Date: </span>Fri, 9 Mar 2012 14:42:21 -0800<br>
    <span style="font-weight:bold">To: </span>Trevor Allen &lt;<a href="mailto:tallen@test">tallen@test</a>&gt;<br>
    <span style="font-weight:bold">Subject: </span>[#3386]: Test<br>
    </div>
    <div><br>
    </div>
    <font face="Candara,Verdana,Arial,Helvetica" size="3">
    <p><!-- breakline was here -->
    EDIT:
    I added the following as a breakline to catch that code:
    Code:
    'span #from:#i /span #.*# a #.*# /a'
     
  20. tallen-bt

    tallen-bt Established Member

    It seems your code removes the following:
    Code:
    <?xml:namespace
    Leaving this in the email body:
    Code:
    prefix = o ns =
    "urn:schemas-microsoft-com:office:office" />
    Full code:
    Code:
    <?xml:namespace prefix = o ns =
    "urn:schemas-microsoft-com:office:office" />
     

Share This Page