Skip to main content
Question

Why JSON Reader reads the email as html instead of plain text ? Any transformer that I could add after JSON Reader to avoid this issue?

  • Jul 24, 2023 9:41 PM UTC
  • 2 replies
  • 97 views

jaygrg111_
Contributor
Forum|alt.badge.img+9

I am automating a process of creating a Service Request on City works suing an Email (IMAP) topic and notification on FME Server. However, when email is received, my Workspace reads (JSON reader) it as an html instead of plain text and charset- utf=8; I have JSON extractors and HTTPO caller later in the Workspace and therefore due to this problem fails to create SR. I am attaching an image from the log file. Any feedback is much appreciated.

2 replies

itsmatt
Celebrity
Forum|alt.badge.img+48
  • Celebrity
  • Jul 26, 2023 12:54 PM UTC

So from the content type you can see that it's set to text/html - this means that the content of the email body itself is HTML. One thing you can do it to do a test on the content type and, if HTML, then you can use an HTMLExtractor.

 

You can see here that the JSON reader has worked correctly, it's parsed the JSON from the FME Server notification into fme attributes.

 

There is some more info here about it: https://docs.safe.com/fme/html/FME-Flow/ReferenceManual/IMAP_Publisher_Notification_Content.htm


jaygrg111_
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • Jul 28, 2023 9:26 PM UTC

So from the content type you can see that it's set to text/html - this means that the content of the email body itself is HTML. One thing you can do it to do a test on the content type and, if HTML, then you can use an HTMLExtractor.

 

You can see here that the JSON reader has worked correctly, it's parsed the JSON from the FME Server notification into fme attributes.

 

There is some more info here about it: https://docs.safe.com/fme/html/FME-Flow/ReferenceManual/IMAP_Publisher_Notification_Content.htm

@virtualcitymatt​ Thats a good idea. I will try. Thank you so so much.