- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 07:17 AM
Hi, I have a particular email that contains html in the body but my inbound action is not parsing it as html. Instead it thinks it is plain text and displays the html tags in my incident description field.
The inbound action is correct as it works for all other emails but ones coming from a particular vendor. I am thinking perhaps there is something in the html that is causing this.
Has anyone had this issue before?
Many thanks
Max
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 01:03 AM
hi @CCZMAX1
Use body_text attribute in email object instead of body.
Refer https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0681056
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 05:00 AM
@CCZMAX1 , Try with this below
current.description= email.body_text
OR
current.description= email.body_html
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 01:03 AM
hi @CCZMAX1
Use body_text attribute in email object instead of body.
Refer https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0681056
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 02:13 AM - edited 03-17-2024 02:15 AM
Hi @CCZMAX1 ,
Could you please try doing the below,
current.description = email.body_text.toString();
If the above doesn't work try something like below,
var emailBody = email.body_html.toString().replace(/<br\/>/g, "\n");
current.description = emailBody;
or
current.description = '<pre __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"><p>' + email.body_html + '</p></pre>';
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 07:15 AM
@CCZMAX1 , Thanks for marking my answer as helpful. If it helped you in any way please accept the solution so that it will be beneficial to the future readers with the same query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 05:00 AM
@CCZMAX1 , Try with this below
current.description= email.body_text
OR
current.description= email.body_html
Regards,
Shyamkumar
Regards,
Shyamkumar