formatting issue using email.body_text
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2013 11:31 PM
Hi, I am investigating an issue where the inbound email action uses the email.body_text variable and is assigning this value to the description field which is a string. The incoming email content is predominately HTML and the description field results in text where the body (content) of the email is is seperated into several lines when the original email body is HTML and a continuous string without hard returns. The signature block and disclaimer are not stripped out and these are not affected by this formatting issue.
Have looked at inbound actions and using email.body_html however this insert all the incident.description field. Have also looked at system settings without success. Any ideas?
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2013 01:29 AM
if (email.body.description != undefined){
var mytext = email.body_text;
var startpos = mytext.indexOf("Description:[$$");
var endpos=mytext.indexOf("$$]",startpos);
var mydesc = mytext.slice(startpos+15,endpos);
current.description = mydesc;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2013 09:49 PM
Thanks for the comment however I wasn't looking to trim or split an incoming string, I'm trying to answer why an incoming HTML formatted email message is being converted to text and split into several lines rather than leaving it as a single string. If I do find something I'll post. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2013 08:14 AM
Your HTML may be one single line, but if it has BR, DIV, or P tags, the processor may be inserting new lines for those tags as it tries to convert the displayed data into plain text. If you are worried about white-space, simply take body_text and do a replaceAll on the "\n" and possibly "\r" characters to see if that gets it all on one line.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2013 02:25 PM
We have been having a similar problem, but I've got it narrowed down to a certain type of email. If the content_type field contains -- multipart/related; boundary="..."; type="text/html" -- then it will always put, at least, twice as many new lines in the body_text field. This seems to be coming from Outlook, which is what most of our customers use.
I've looked for a script at the database level that processes this, but I can't find it. I'm wondering if it is one of the java files on the server that we don't have access to. It would be good to get some input from the developers.
And, if I would have done a bit more homework, I would have the answer already. log into HI and read KB0522571.