ReadMail

Estimated reading: 5 minutes 3274 views

This activity helps the user to read the mails from the Gmail account. Ensure it is used within the ‘GmailScope’. 

Properties

INPUT

Filter: Specify the filter values that need to be applied while reading emails from the account name. This parameter accepts values in “String” datatype. You can either hardcode the values in “String” datatype or can enter the values in “String”. It is an optional field and reads all emails if no value is provided.

SubFolderName: * Specify the folder name from which the emails need to be accessed and read. You can also provide the “SubFolderName” if you need to read emails from a subfolder.

IncludeSpamTrash: This parameter indicates to include spam and trash mails while reading emails from the specified account. Specify the boolean value as “True” or “False”.
True: Enables to include the spam and trash mails.
False:
The option will not be considered.
None:
 If the option is left blank, the activity will, by default, behave as if “False” were chosen.

MarkAsUnread: This property indicates whether read emails should be marked as unread after the automation is completed. Specify “True” or “False” to enable or disable the marking of emails as unread during the mail reading process.
True: Enables marking emails as unread after they are read.
False: Disables marking emails as unread after they are read.
None: If this option is left blank, the property will not take effect, and by default, emails will be read without marking as unread.

NoOfMails: * Enter the number of emails that need to be read within the specified account name. This parameter accepts values in “Integer” datatype. You can either hardcode the values in “Integer” datatype or can enter the values in “Integer”. 

Unread: Specify whether to read emails that have not been read yet in the mailbox. Specify either “True” or “False” in the field:
True – Enables reading only the “Unread” mails from the mailbox.
False – Disables the condition and reads emails according to the sorting order provided, irrespective of whether they are “Read” or “Unread” mails.
None – When left out blank, the activity will perform with “False” action.

MISC

DisplayNameDisplays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnErrorSpecify the “Boolean” value as “True” or “False.”
True: Continue executing the workflow regardless of any errors thrown.
False:
 Halt the workflow if it encounters any errors.
None:
 If the option is left blank, the activity will, by default, behave as if “False” were chosen.
Version
It indicates the version of the feature being used.

OUTPUT

ListIt helps to store the mails in the list format that has been read from the mailbox. (Refer to the steps in creating a workflow.)
Result: It provides the ability to view the execution status of the activity. It returns values in “Boolean.”
True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown.
Represents mandatory fields to execute the workflow.

Here’s an example of how “Read” activity works – 

In the following example, I am going to read the mail from the specified address. In this case, I am using my personal Gmail account to read from the specific mail address. 

Example

1. Create a new solution or open an existing workflow.
2. Install the latest version of “GmailAutomation” feature from Manage features.
3. Drag and drop the “Gmail scope” activity from the Gmail automation.
a. Navigating to the properties to provide the “mail account name” to authenticate and access the mailbox.
b. Next moving to the “keypath” and here i am providing my “Json” file path in “String” datatype. Click here to know how to get the keypath.
4. Now, placing the “Read mail” activity inside the body of the Gmail scope activity.
a. It helps to read the mails from the specified account.
b. Here in the “Filter” option, I am providing the mail address from which the mails need to be processed and read.
c. Next, as my specified mail address is available in the “Inbox” folder, I am providing the “FolderName” property value as “Inbox”.
d. Specifying the number of mails to be read as “5”.
e. Now, navigating to the “List” in the output section of the properties to declare a variable to view the output. 
     i. Method 1 – Click on the “List” property within the “ReadMail” activity and enter the variable name. In this case, we are using “Read_ml.” Then, press “Ctrl+Q,” which is a shortcut key to create a variable.
    ii. Method 2 – Click on the Variables pane and enter the name “Read_ml.” Then, in the “Variable Types” column, sele ct “Browse for Types” from the dropdown menu.
   iii. The .Net window for data types will appear on the screen, enter the type of name as “System.Collections.Generic.List” and choose “Robility.GmailAutomation.GmailMessage” then click on “OK” button.
5. Now, execute the workflow.

Share this Doc

ReadMail

Or copy link

CONTENTS