Using the MicrosoftOutlook connector
This example solution shows how to trigger automation actions based on a Microsoft Outlook email being replied to. The automation sections are shown below:
In this part of the automation, the triggering event is when the Reply button is clicked in Outlook. The email that is being replied to is retrieved and a proxy is generated for the email to access the individual properties of the email. The email To property is compared to a name string Andrea Ridgway. If the To property matches the set text string, a message displays informing the user to Copy Sales on all messages sent to A. Ridgway.
In this part of the automation, the triggering event is when the user clicks the Send button in Outlook. The SentOn date and Subject are retrieved from email proxy, concatenated in a StringExpression, and added to a list box. A method for clearing text from the list box is included.
How to create this solution
Create a Windows form that contains a list box and a button. Name the button btnClear and set the button text to Clear.
Add an automation to the solution.
Add the MicrosoftOutlook component to the automation. It will display in the Component Tray.
Set the Folder property for the MicrosoftOutlook component to a folder for which you want to monitor email replies. For example, to monitor the IT folder, which is a subfolder in the Inbox, you would enter Inbox\IT.
Set the Monitor property for the MicrosoftOutlook component to True.
Set the ReadType property for the MicrosoftOutlook component to All.
Find the MailReplied event for the MicrosofOutlook component and add it to the automation.
Click the arrows in the MailReplied design
block to display the event's properties.
Right-click on
the Mail output of the MailReplied event and select the Extract Proxy
option.
A proxy object, microsoftOutlookMailProxy is created.
Select the proxy object in Object Explorer and then view the available properties.
Select the To property of the microsoftOutlookMailProxy and drag it to the automation.
Add a string variable to the automation and set the text value to a the name of a person from whom you receive email. For more information, see String Variable.
Add a Boolean expression to the automation and set the expression to a == b. Set the Identifiers for the expression to String type. Boolean Expression.
Right-click on the Result data output of the Boolean Expression and select Make Decision. A Boolean Decision diamond is displayed on the automation.
Add a MessageDialog component to the automation and set the Message. For more information, see MessageDialog.
Connect the design blocks as shown in the Flag Email image shown above.
Run the solution. It will take a few seconds for Studio to process the mail in the folder you selected. The more mail in the folder, the longer the processing time. Next, find an email from the person you identified in the string variable. Highlight the email and click the Reply button. A message should display as the email is opened for reply.
To complete the solution, perform the following steps.
If the solution is running, stop it and return to the automation in Studio.
Locate the MailSent event for the MicrosoftOutlook component and drag it to the automation.
Locate the SentOn property for the microsoftOutlookMailProxy and drag it to the automation.
Locate the Subject property for the microsoftOutlookMailProxy and drag it to the automation.
Add a DateTimeUtils component to the solution and use the ToString method of the component. For more information, see DateTime Utils.
Add a String Expression to the automation and set the Expression to a+" "+b. For more information, see String Expression.
Use the Explore Component Properties view in Object Explorer for the list box.
Select the Items property and then click the Configure Type button to explore all properties and methods for the Listbox.item.
Locate the Add method and drag it to the automation.
Locate the Clear method and drag it to the automation.
Connect the design blocks as shown in the Copy Email to Listbox section above.
Save and run the solution. After you select an email to reply to, enter your reply and click the Send button. The date time of the reply and the subject of the reply email will displays in the list box on the Windows form. You can remove the list box entry by clicking the Clear button.
Privacy | Trademarks | Terms of Use | Feedback
Updated: 01 July 2024
© 2016 - 2024 Pegasystems Inc. Cambridge, MA All rights reserved.