Retain HTML for inbound emails

scottangehr
Giga Guru

We would like to retain HTML formatting from inbound emails and insert them into the comments.

I placed the following code into the inbound email actions and I'm getting a result I don't expect.

BR: current.comments =   '[code]' + email.body_html + '[/code]';

Result:

2016-03-09 13:31:59 - Scott Angehr   Additional comments

lang="EN-US" link="blue" vlink="purple">

State

Type

Caller

Severity Level

Category

Short Description

Active

Project

Justin Thyme

Standard

ServiceNow

Create Timesheet app tied with Project Mgmt

Scott Angehr

ServiceNow Administrator

It includes part of the email header and I haven't been able to edit to exclude this.

Any thoughts would be greatly appreciated!

Thank you,

Scott

6 REPLIES 6

Community Alums
Not applicable

Have you considered creating another 'Description' field of type HTML? Unless you need to utilize the journal field functionality.



I did this to handle HTML formatted emails like yours above; formatted tables, etc.



Cheers,



Tim


Thank you for the response.   The users wish to keep additional comments as their initial journal.


nidhi_batavia
Kilo Contributor

Hi,



I used the same code mentioned by you in my incident inbound action but its giving me complete HTML code rather than formatted one,


Please suggest.



current.comments =   '[code]' + email.body_html + '[/code]';


Jesse Bates
Kilo Contributor

This is an issue we are experiencing. When sending an HTML email to SNOW all the formatting is stripped from the email in the comment section. 

Could someone please assist with this issue.