Microsoft Email Adapter in an Oracle Integration Cloud Service allows retrieving messages in Office 365 and Outlook.com. The Microsoft Email Adapter enables to manage messages, manage folders, and so on.
In this blog, will demonstrate how to read messages from outlook from a specific folder.
Below is the pre-requisite to complete the blog:
- Microsoft account: If you don’t have MS account, create an account using https://signup.live.com
- Configure Microsoft Email Adapter in ICS: Please see the blog to configure MS Email adapter in ICS
Let’s continue and create an Integration which will show step by step procedure to read messages from MS account
1) Create a Scheduled based integration with Oracle ICS
2) Drag & drop the MS Email adapter just below the scheduled activity
3) The configuration wizard will get open. Enter endpoint name and click Next button
4) Next screen will show all the available operation that can be performed on MS account using ICS MS email adapter. For example, Create a folder, Delete a message, Delete attachments, Get messages, Get messages of a folder etc.. For this specific use case, let’s select Get messages of a folder operation an click Next button
5) The next page will show the summary of the configuration. Simply Click Done
Notice a Template parameter with name folder_id. This is the folder name from which all the message would be read.
6) Edit the ReadEmails mapper and enter Inbox in the folder_id template parameter
7) Let’s iterate all the message using for each activity and print the Subject and sender of the message,. Except these, there are lots of properties which can be taken out from the read email response. Let’s drag and drop for each activity just below the ReadEmails adapter and complete configuration:
- Name: Enter IterateEmails
- Repeating Element: value is the repeated element which contains all the properties related to a specific message. Drop the value element in Repeating Element text box
- Current Element Name: Enter CurrentMessage
Once all above options are configured, Click Done button to close the popup
8) Let’s print some relevant properties of an email. Drop logger action under foreach loop
9) Let’s print Subject & Sender of the message in the logger. Configure below expression in the logger:
concat(‘Subject is ‘ ,$CurrentMessage/nsmpr1:value/nsmpr1:Subject, ‘ Sender of the message ‘ ,$CurrentMessage/nsmpr1:value/nsmpr1:From/nsmpr1:EmailAddress/nsmpr1:Address)
10) Activate the integration and submit it once
11) Go to Monitoring dashboard, open the instance and open Activity Stream to see the logger activity
If you have 10 messages in your Inbox, the loop will be iterated 10 times and all Subject and Sender of the messages will be printed.
Next blog will show how to filter messages from the inbox.