Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion pages/toolkits/productivity/microsoft/outlook_mail.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ These tools are currently available in the Arcade Sheets toolkit.
["ReplyAllToEmail", "Reply to all recipients of an existing email in Outlook."],
["ListEmails", "List emails in the user's mailbox across all folders."],
["ListEmailsInFolder", "List the user's emails in the specified folder."],
["ListEmailsByProperty", "List emails in the user's mailbox across all folders filtering by a property."]
]}
/>

Expand Down Expand Up @@ -305,6 +306,32 @@ Exactly one of `well_known_folder_name` or `folder_id` MUST be provided.

---

## ListEmailsByProperty

List emails in the user's mailbox across all folders filtering by a property.

**Parameters**

- **`property`** (enum ([EmailFilterProperty](#emailfilterproperty)), required): The property to filter the emails by.
- **`operator`** (enum ([FilterOperator](#filteroperator)), required): The operator to use for the filter
- **`value`** (string, required): The value to filter the emails by.
- **`limit`** (int, optional): The number of messages to return. Max is 100. Defaults to 5.
- **`pagination_token`** (str, optional): The pagination token to continue a previous request

<TabbedCodeBlock
tabs={[
{
label: "Call the tool with user authorization",
content: {
Python: ["/examples/integrations/toolkits/microsoft/outlook_mail/list_emails_by_property_example_call_tool.py"],
JavaScript: ["/examples/integrations/toolkits/microsoft/outlook_mail/list_emails_by_property_example_call_tool.js"]
}
},
]}
/>

---

## Auth

The Arcade Outlook Mail toolkit uses the [Microsoft auth provider](/home/auth-providers/microsoft) to connect to users' Microsoft accounts.
Expand Down Expand Up @@ -337,4 +364,27 @@ The type of reply to send to an email.
- **`REPLY`** _(string: "reply")_
- **`REPLY_ALL`** _(string: "reply_all")_

<ToolFooter pipPackageName="arcade_microsoft" />
<ToolFooter pipPackageName="arcade_microsoft" />

### EmailFilterProperty

The property to filter the emails by.

- **`SUBJECT`** _(string: "subject")_
- **`CONVERSATION_ID`** _(string: "conversationId")_
- **`RECEIVED_DATE_TIME`** _(string: "receivedDateTime")_
- **`SENDER`** _(string: "sender/emailAddress/address")_

### FilterOperator

The operator to use for the filter.

- **`EQUAL`** _(string: "eq")_
- **`NOT_EQUAL`** _(string: "ne")_
- **`GREATER_THAN`** _(string: "gt")_
- **`GREATER_THAN_OR_EQUAL_TO`** _(string: "ge")_
- **`LESS_THAN`** _(string: "lt")_
- **`LESS_THAN_OR_EQUAL_TO`** _(string: "le")_
- **`STARTS_WITH`** _(string: "startsWith")_
- **`ENDS_WITH`** _(string: "endsWith")_
- **`CONTAINS`** _(string: "contains")_
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Arcade } from "@arcadeai/arcadejs";

const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable

const USER_ID = "[email protected]";
const TOOL_NAME = "Microsoft.ListEmailsByProperty";

// Start the authorization process
const authResponse = await client.tools.authorize({
tool_name: TOOL_NAME,
user_id: USER_ID,
});

if (authResponse.status !== "completed") {
console.log(`Click this link to authorize: ${authResponse.url}`);
}

// Wait for the authorization to complete
await client.auth.waitForCompletion(authResponse);

const toolInput = {
property: "sender",
operator: "contains",
value: "arcade.dev",
limit: 10,
};

const response = await client.tools.execute({
tool_name: TOOL_NAME,
input: toolInput,
user_id: USER_ID,
});

console.log(response);
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from arcadepy import Arcade

client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable

USER_ID = "[email protected]"
TOOL_NAME = "Microsoft.ListEmailsByProperty"

auth_response = client.tools.authorize(
tool_name=TOOL_NAME,
user_id=USER_ID,
)

if auth_response.status != "completed":
print(f"Click this link to authorize: {auth_response.url}")

# Wait for the authorization to complete
client.auth.wait_for_completion(auth_response)

tool_input = {
"property": "sender",
"operator": "contains",
"value": "arcade.dev",
"limit": 10,
}

response = client.tools.execute(
tool_name=TOOL_NAME,
input=tool_input,
user_id=USER_ID,
)
print(response)