Inbound Action: email.body_text and HTML

Jamsta1912
Tera Guru

Hello all,

I have an inbound email action set up against the incident table.

I'm populating the 'description' field using this:

current.description = email.body_text;

Standard so far, and I have a number of other inbound actions doing the same thing.

However, in this particular case the description field is being populated with the raw HTML of the inbound email, rather than just the actual text.

Any suggestions on why this might be happening?

Jamie.

18 REPLIES 18

Hi Jaimie,



I don't off-hand, although I'm sure you can find some existing code out there made to strip out the HTML coding.   However, my recommendation would be to try and find the cause of the problem instead of hacking a fix.   Using the email.body_text field SHOULD work, and does for the most part as you mentioned... so why is it breaking in this scenario?



I would suggest you first check the messages and check the scripts:


  1. Check your message in the [sys_email] table, is the body_text appearing properly there?   If not, maybe that's how it is arriving in the message (i.e., sender email client issue).
  2. Find a message that was already processed properly by another Inbound Action (i.e., a "known good"), then change the criteria for your IEA in question and reprocess that message to see if it is handled properly by the IEA you are having trouble with.   If it generates an INC with a proper description, then again the issue is probably with the previous messages you've been using to test.   If it does not, then there is most likely a problem with your code in the IEA.


It would also help if you copy/paste your IEA code here for us to take a look at.




Thanks,


-Brian


Sudipta Pattna1
Kilo Expert

Hi Jamie,



Use current.short_description = email.body_text



This will Must Work. I Tested...



Regards


Sudipta Pattnayak


Hi Sudipta,


Thank you for your reply.


That's how I usually do it, but it's not working in this case. I think it is something to do with the HTML content of the emails from this specific customer.



Jamie.


Or else try with


Hi Jamie,

did you end up getting anywhere with this, I've got the exact same issue despite trying everything above. We have a HR system that generates these on-boarding emails with loads of HTML and as with your case none of the tried and tested methods above work in stripping out the html tags. Unfortunately I cannot ask the sender to change this as it is system generated.

So I was hoping you eventually came up with a solution yourself in your inbound action you may be able to share to ease my pain?