EmailManager and HTML parsing

Hey guys,

I have a client that is using the EmailManager for processing incoming emails. One of the emails they get comes from a website where the customer enters some information in and the body of the email contains html with id tags. The customer needs to be able to parse that data out to put into the Case record. Unfortunately since the javascript is executing outside the context of a browser I don't have a DOM so I can't call getElementById to get the values. Surely there have been other customers who have requested this?? Has anyone had any luck parsing the html body. I've scoured the internet looking for ways to do this but it doesn't seem possible when running outside the context of a browser. Does anyone know what the EmailManager is using to run the javascript? Node.js? A headless webkit? Something else? Much appreciated. Thanks :-)

Brad

  • 0

    Hi,

    No, you cannot do it this way. When mail is coming from website you must be having control on format in which it is sent, then the standard practice would be to send the email in format required by you. For an example below format.

    Dinesh M
    9987123456

    Now when this email hits the inbound module in CreateCase method you can write code to extract values between tags. You can either use regular expressions or split and collect methods to get the values.

    Hope this helps!

    Regards,
    Dinesh