Introduction

This Usecase is about building an email based work-flow system. This provides a very useful framework to easily trigger events and execute relevant actions just with the help of emails. Given below are four distinct scenarios we need to build:

1. Save incoming email to Database and email attachments to file system

In this task we will read an email, get its subject, attachments and store it in our local file system and make an entry into database table.
At the end of this task you will be able to,

a) Read an email with attachments via IMAP
b) Save email details to a Database
c) Save the email and attachments locally in your File system

 

2. Country Lookup Services

This use case polls an email, gets the country name from subject and calls external webservice to get country details like Country Name, Country Code, Currency, Currency Code and sends the response as HTML, back to the caller. It also records the Action and Response into the database and writes the response to a file.


3. Currency Conversion Service

This use case polls an email, gets the ‘from’ and ‘to’ currency for conversion from the subject and calls yahoo finance API to get conversion rates in CSV format. This CSV can contain multiple records which are sent back to the caller as HTML. It also records the Action and Response into the database and writes the response to a file

4. Get Customer details from Salesforce

This use case polls an email to get Account Name from the subject and calls salesforce to get the account details. These details are converted to HTML format and sent back to the caller. It also records the Action and Response into the database and writes the response to a file


Learnings:

– Learn how to use IMAP/Email, Salesforce, SOAP, Database and File Connectors
– Understand Enrichment processors
– Understand how web services work and SOAP messages work
– Understand how API works
– Exception Handling