email formatting gone in comments?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 04:20 AM
Hello Everyone,
I encountered the following issue when using case comments for customer updates.
When using comments for updating customer in rich text, all the format and embedded images are OK when they reach the customer email client.
The problem is when the customer replies from the email client with some formatted text and embedded image, when it reaches the case comments, the formatting is gone and the embedded image is gone too.
In this case the "Test 2 from outlook" was sent in bold and underlined from outlook.
"www.google.com" is a hyperlink but it does not work
And the embedded image is also gone:
do you know why this happens? did somebody manage to fix this defect?
Thanks
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2022 09:02 PM
Hi, as a first check I would review the inbound action that was processing the message(s) and ensure that script(s) were referencing\mapping email.body (IE the HTML message) and not email.body_text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 02:23 AM
Hello
thanks for your feedback, I checked the inbound action for this, and found this in the code:
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
I tried the following:
current.comments = "reply from: " + email.origemail + "\n\n" + email.body;
and
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_html;
But it does not make a difference, is this what you mean in your answer above? or am I missing something else?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 11:23 AM
Hi, apologies in my response I typed email.body and should have referenced email.body_html and I also failed to mention that if you want the HTML to appear in your journal, assuming the journal is configured to allow HTML and high security is enabled (I think this is a default in 'modern instances'), you will also have to encapsulate in 'code' tags so that the instance knows to render it correctly.
https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/field-administration/task/render-journal-field-entries-as-html.html
I normally use a check to confirm that the html exists, perhaps try something like this
if (email.body_html) {
current.comments = "Received from: " + email.origemail + "\n\n [code]" + email.body_html + "[/code]";
} else {
current.comments = "Received from: " + email.origemail + "\n\n" + email.body_text;
}
is
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 03:56 AM
Hello
thanks so much, you know what? I got this working on my free personal developer instance.
However for my company dev instance still not working even thought it is the same code, how bizarre, this is driving me insane.
When you say "assuming the journal is configured to allow HTML and high security"
I have this setting set to yes in both my free instance and my company dev instance:
what you do mean by "high security is enabled".
Where do I enable High Security ?
Thanks.