Question

Parsing email body text recieved by FME server via IMAP

  • 13 February 2020
  • 4 replies
  • 18 views

Badge

Im looking to parse an email recieved by FME Server Topic via Imap

The JSON looks like this 

{ "imap_publisher_received": "Tue Feb 11 16:24:07 PST 2020", "imap_publisher_sent": "Tue Feb 11 16:24:00 PST 2020", "ws_topic": "RECIEVE_SURECALL_EMAIL", "imap_publisher_subject": "[EXTERNAL] Message from Surecall Contact Centres ", "imap_publisher_from": "updates@surecallcc.com", "imap_publisher_content{0}": "CAUTION: THIS EMAIL ORIGINATED FROM OUTSIDE THE ORGANIZATION. DO NOT CLICK ON LINKS OR OPEN ATTACHMENTS YOU DO NOT TRUST.\r\n -------\r\n\r\n| 2/11/2020 5:21:32 PM/5:21:32 PM |\r\nCall Type: Other\r\nRe: Customer got a letter that he has to take care of pruning his tree before February 6 and is not happy about it.\r\nAdvised caller to call  during business hours.\r\n\r\n", "imap_publisher_to": "roads@xxxxxx.ca", "imap_publisher_content_type{0}": "text/plain; charset=us-ascii", "fns_type": "imap_publisher" }

Im using a Json reader and an Attribute Splitter  for the attribute " imap_publisher_content{0}" and get something like this 

0684Q00000ArEA7QAN.png

My goal is to Extract the Date , Time, Call Type, Re details as attributes and values .

I intend to make a json payload and send it to Cityworks application via an API to create a service request.

Any help will be much appreciated.


4 replies

Badge +22

This is a bit of a brute force approach, but the attached workspace might do it.

 

107974-parseemail.fmw

Badge

This is a bit of a brute force approach, but the attached workspace might do it.

 

107974-parseemail.fmw

Hello @jdh,

appreciate your quick reply, Im on an older version of FME desktop ,will try to open this workspace in the newer version and let you know

Badge

This is a bit of a brute force approach, but the attached workspace might do it.

 

107974-parseemail.fmw

Hello @jdh

your solution workspace worked like a charm , The regular expression worked

appreciate your help !!

Badge

I had used the "-------" as delimiter and extracted the list

Reply