Last time I showed how easy it is to consume excel files into an iRPA bot using the Excel SDK, this time we will see how to let our bot send emails using the Outlook SDK, maybe to remind customers of pending payment.
Let’s get to it.
- Create a new project in the iRPA cloud factory
- In order to use the prebuilt outlook capabilities, we need to add the outlook SDK dependency to our project, Under the dependencies tab
- Now let’s create a new automation, (call it sending emails)
- For simplicity, we will add an open input dialog to capture the email address from the user
- Note that the outlook SDK added a few activities that we could use to interact with MS Outlook
- I will use the custom script to show how to configure the outlook SDK programmatically, let’s add one
- A custom script is nothing but a function so we need to define what data inputs do we expect to be passed on to the actual script to execute, we choose the prebuilt data type, Email Item Parameters, and give it a name emailTemplate
- Let’s do mapping between the input parameter and the captured user input value (to email)
Note that other fields could be filled either statically like I did or dynamically from user input or an excel file
- Let’s open the script and add the following code snippet, which basically opens the local outlook client, and pass the email template input then closes the local client
irpa_outlook.application.openOutlook(); irpa_outlook.email.send(emailTemplate); irpa_outlook.application.closeOutlook();
and that’s all, we can now proceed to test out the bot, click the test button.
An input dialog will pop up, enter the send to email and click ok.
You will notice the outlook client is opened and an email was sent then the outlook client is closed.
You can also verify that the steps were executed successfully by examining the tester pane.
Hope this gave you a good idea of the prebuilt outlook SDK and open potential of possibilities in your next bot.