Solved

Using Email trigger message in a Workspace

  • 15 November 2022
  • 3 replies
  • 45 views

Badge +10

It's been a while since I last used FME and now it's time to start working with automations  seriously. I need some help to get a quite simple one working though.

 

I'm attempting to do the following: whenever an email from a certain email address and with a certain concept in the subject is received, the email subject and body must be checked and parsed to write a temporary json file that will be uploaded to a server via sftp overwriting the existing file.

 

I already have:

  •  An email trigger with a Subject filter.
  •  A 'Sent from Address' filter action.
  •  A workspace action: AttributeManager and JSONTemplater transformers and a JSON writer get the important information from the subject and content of the email into a json file that is written to FME Server temp directory. 
  • An SFTP Directory external action: reads the json file from FME Server temp directory and writes it to a server.

 

The problem is that we are waiting for imap access to be enabled on the email account so I cannot test the email trigger to see  how will it output a message and decide the approach to read it inside the workspace.

 

I enabled email.subject, email.body and email.from event keys for the  success port. Will the message be a json string or will it be written as a json file inside fme server resource directory? Will it be something like this maybe?

{
"email.subject": "...",
"email.body": "...",
"email.from": "..."
}

 

Thanks.

icon

Best answer by redgeographics 15 November 2022, 16:24

View original

3 replies

Userlevel 4
Badge +25

If you set up user parameters on the workspace that processes this you can simply pass the values on.

Screenshot 2022-11-15 at 16.20.03If you want to try this for yourself, the FME Academy module Build Versatile Automations covers this.

Badge +10

Easier than I thought.

Thanks @Hans van der Maarel​ .

Userlevel 4
Badge +25

Easier than I thought.

Thanks @Hans van der Maarel​ .

You're welcome!

Reply