Gmail Automation - Read Mail

ReadMail

When to use the ReadMail Activity

Use this activity when you want to read emails from Gmail account.

Read Mail activity will be the precursor for all other activities in the Gmail Automation Package, except for one.. That is, all other activities (Get Mail Details, Move Mail, Reply and Save Attachment) will be connected to the read mail activity and will work in conjunction with the input and output of the read mail activity. However the only exception will be Send Mail activity for which we do not require a read mail activity and it can be used independently.

Figure 1

1

Drag and drop a ReadMail activity inside the Gmail Scope from the Gmail Automation Package. (1) Fill appropriate details in all fields in the property window. Refer Figure 4. The output will be returned as a List of Gmail Message. You are required to create two variable types to successfully execute this activity. (2)  First create a List< Gmail Message> variable. Next create a Gmail Message Variable. (3) Now pass the List< Gmail Message> variable in the Output List. (4)

Figure 2

2

Drag and drop a WriteLog activity and provide the input string. Execute.

Figure 3

4

Technical Reference

Figure 4

4

Note: Filter syntax to read mail from a particular sender is"from:someuser@example.com.”

This activity was developed using Gmail API services and user is required to store their credential JSON file (Client Secret Key File) in a path accessible by the robot to execute this activity and for the first time, users are required to manually authenticate their application to allow for the required mail id.

Sort option is not available in Gmail API, so sorting cannot be done while reading mails. Output will be a list of mail messages, user cannot get the details (To, From, Subject, Body, etc.) from a message directly. They need to parse the message to a MIME kit for getting those details.

Please use the GetMailDetails in the package, which will extract details from the mail messages.

Please refer the below guide for how to input filter strings.

https://developers.google.com/gmail/api/guides/filter_settings

Version
1.0.2