VMware Cloud Community
Bunty11
Hot Shot
Hot Shot
Jump to solution

vRO Email Reading

Can vRO monitor a Mailbox ?

Can it read the email that are received on the mailbox ??

And Based on Email Reading

Can it initiates a workflow ?

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
eoinbyrne
Expert
Expert
Jump to solution

Yes to all using the SMTP plugin.

You can use a scheduled workflow to poll a mailbox via POP3 or IMAP

You can retrieve email messages and extract the content

You would need to write a parser of some kind to process the email content

Once you have a parser you can trigger workflows to be executed based on the content

I've done all of this before and it works fine

-Eoin

View solution in original post

Reply
0 Kudos
3 Replies
eoinbyrne
Expert
Expert
Jump to solution

Yes to all using the SMTP plugin.

You can use a scheduled workflow to poll a mailbox via POP3 or IMAP

You can retrieve email messages and extract the content

You would need to write a parser of some kind to process the email content

Once you have a parser you can trigger workflows to be executed based on the content

I've done all of this before and it works fine

-Eoin

Reply
0 Kudos
MickeyO
Contributor
Contributor
Jump to solution

Hi Eoin,

Do you have any code examples for parsing the emails?  Specifically I just want to filter on the subject and certain words in the content of the email reply.

Thanks.

Reply
0 Kudos
eoinbyrne
Expert
Expert
Jump to solution

It depends on the format tbh. If you are just looking for keyword presence then you can do a lot with Regex matches or String.indexOf calls.

E.g., if you wanted to check for the word Linux in the subject line you can do this

var subjectContainsLinux = (mail.subject.indexOf("Linux") > -1)

You can do similar things with the mail content depending on the format. If the mail content is a MultiPart and the MimeType is say "text/html" then you'd have to be able to parse the HTML to get the raw text or identify specific tags. If you google JS HTML parser you'd probably find examples around for free.

In my case I had agreed a specific data exchange format with the client so emails that didn't meet the format criteria could be discarded. The format was similar to Java properties files but with definitive block start and end tokens (originally intended to permit multiple blocks in the mail body, e.g.,

START-TOKEN

propertyKey1=propertyValue

propertyKey2=propertyValue

END-TOKEN

Anyway, HTH

Reply
0 Kudos