Create Email Rule
emailrules_createAutomatically process incoming emails by creating rules that move, forward, categorize, or delete messages based on conditions like sender, subject, or attachments.
Instructions
✏️ Create a new inbox message rule to automatically process emails (requires user confirmation recommended)
Rules are executed in priority order (sequence number).
Conditions examples: {"fromAddresses": [{"address": "john@example.com"}]} {"subjectContains": ["urgent", "important"]} {"senderContains": ["@company.com"]} {"hasAttachments": true}
Actions examples: {"moveToFolder": "folder_id"} {"markAsRead": true} {"forwardTo": [{"emailAddress": {"address": "manager@example.com"}}]} {"assignCategories": ["Red category"]} {"delete": true}
Args: account_id: Microsoft account ID display_name: Name for the rule (e.g., "Move work emails to Projects") conditions: Conditions that trigger the rule actions: Actions to perform when conditions match sequence: Rule execution order (lower numbers execute first, default: 1) is_enabled: Whether the rule is active (default: True) exceptions: Optional conditions that prevent rule execution
Returns: Created rule with its ID and full configuration
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| display_name | Yes | ||
| conditions | Yes | ||
| actions | Yes | ||
| sequence | No | ||
| is_enabled | No | ||
| exceptions | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||