Inbound action - not parsing html

CCZMAX1
Mega Sage

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

2 ACCEPTED SOLUTIONS

Sohithanjan G
Kilo Sage
Kilo Sage

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

 

 

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

View solution in original post

shyamkumar VK
Kilo Patron

@CCZMAX1 , Try with this below 

 

current.description= email.body_text
OR
current.description= email.body_html

 

Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

View solution in original post

4 REPLIES 4

Sohithanjan G
Kilo Sage
Kilo Sage

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

 

 

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

swathisarang98
Giga Sage
Giga Sage

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

@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.

shyamkumar VK
Kilo Patron

@CCZMAX1 , Try with this below 

 

current.description= email.body_text
OR
current.description= email.body_html

 

Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar