Definition and Usage
This command retrieves one or more email messages from a specified email account. It allows you to fetch emails based on various criteria such as read status, folder location, and content filters.
Parameter Values
Input parameters
Parameter | Description | Possible Values | Required | Options / Notes |
Mailbox | Select a variable that contains the email to work with |
| Yes | Must contain a valid email connection |
Email count | Enter the number of emails to get |
| Yes | Must be a positive number |
Retrieve | Specify whether to retrieve all messages in the folder or only the unread ones | All emails, Unread emails, Read emails | Yes |
|
Advanced settings
Parameter | Description | Possible Values | Required | Options / Notes |
Mail folder | Select target folder to retrieve emails from (default: Inbox) | Default folder, Select a folder | No |
|
Mail folder name | Enter the name of the email folder to filter the messages |
| No | Required only when "Select a folder" is chosen |
Mark as read | Retrieve email and mark it as read |
| No | Checkbox option |
"From" contains | Search for emails from senders whose address contains the provided text |
| No | Case-sensitive filter |
"To" contains | Search for emails sent to recipients whose email address contains the provided text |
| No | Case-sensitive filter |
"Subject" contains | Filter emails whose subject includes the given text |
| No | Case-sensitive filter |
"Body" contains | Search for emails whose body contains the specified text |
| No | Case-sensitive filter |
Error handling
Parameter Name | Description |
Throw error & stop | When an error occurs, the action will trigger an error and stop the execution of the entire app. |
Retry command | If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process. |
Ignore error & continue | When an error occurs, the action will be ignored, and the workflow will continue without interruption. |
Variables produced
This action produces a variable containing the retrieved email messages. The output is stored in the variable specified in the "Store mail messages in" parameter.
Using Variables in Conditions
You can use variables in parameters where the {x} icon appears. This allows you to dynamically set values such as email count, filter criteria, or folder names based on previously defined variables. For example, you might use a variable to specify how many emails to retrieve based on a user input or another system parameter.
Notes
Before using this command, ensure that you have established a valid email connection using a Connect to Email action.
The retrieved emails will be stored in the specified output variable as a collection that can be iterated through.
Filter criteria (From, To, Subject, Body) are applied using a "contains" logic and are case-sensitive.
If no emails match the specified criteria, an empty collection will be returned.
When using the "Mark as read" option, emails will be marked as read immediately upon retrieval.