Read Email with HTML content

Hi All,

My requirement is to poll an SMTP port, and read email body which has content as Matrix table with Customer Information details and create a Canonical or XML with Customer Information that can be used for mapping business requirements.

I tried following steps based on Content Type,
1>createMimeData
2>io:streamToBytes
3>bytesToString

The email Body String looks something like this:

P.ImprintUniqueID { MARGIN: 0cm 0cm 0pt } LI.ImprintUniqueID { MARGIN: 0cm 0cm 0pt } DIV.ImprintUniqueID { MARGIN: 0cm 0cm 0pt } TABLE.ImprintUniqueIDTable { MARGIN: 0cm 0cm 0pt } DIV.Section1 { page: Section1 }

 

r/FONT>


Please advise how to read HTML and convert to IS Document in the pipeline to perform mapping.

thanks,

I think U can use

pub.xml: xmlStringToXMLNode
pub.xml: xmlNodeToDocument

or if U looking for any specific form fields U can do regular expression string pattern matching.

Hi Venkata,

Thank you for responding. I tried the above steps and found the document created with all HTML tags prefix to the values.

Can you elucidate on regex matching, you have mentioned. I have no idea about it.

I thought if you are looking to extract any particular field value in the html string

like “Name: XYZ”, U could use a pattern match lile /Name: (.*)/ to the match the string to get value

Hello,

May I know if this has been resolved?
How can i transform HTML email content to some csv or flat file format like json?