Skip to content

Conversation

@mikahanninen
Copy link
Contributor

Summary

Add new emails_as_csv action and fix several bugs in the Microsoft Mail action package.

New Feature

  • emails_as_csv action: Export email search results as CSV files attached to chat, with configurable columns and folder filtering using Microsoft Graph API OData query syntax.

Bug Fixes

  • Fixed reply_to_email crash ('list' object has no attribute 'attachments'): The Email.attachments field used default_factory=list which created a plain [] instead of an EmailAttachmentList instance. Changed to default_factory=EmailAttachmentList and added a guard check (matching create_draft/send_email patterns) before iterating attachments.
  • Fixed reply_to name resolution in _set_message_data: Was referencing message.reply_to.name.address (nonexistent attribute chain) instead of message.reply_to.address.
  • Fixed forward_email and move_email: Now return descriptive success messages instead of raw API response objects.
  • Fixed add_category and remove_category: Return descriptive success messages instead of raw API responses.
  • Fixed _get_inbox_folder_id: Raises ActionError (proper action error) instead of ValueError.

Cleanup

  • Removed debug print() statements from add_category and _base64_attachment.
  • Removed unnecessary variable pre-initialization in _read_file and _base64_attachment.
  • Simplified type hints: Optional[Union[str, None]]Optional[str], Optional[Union[Literal[...], None]]Optional[Literal[...]].
  • Replaced .keys() membership checks with direct in operator usage.
  • Marked subscribe_notifications, delete_all_subscriptions, delete_subscription, and flag_email as is_consequential=True.

Dependencies

  • Updated python-dotenv 1.1.1 → 1.2.1
  • Updated sema4ai-actions 1.4.2 → 1.6.6
  • Updated pydantic 2.11.7 → 2.12.5

No new external dependencies were added.

🤖 Generated with Claude Code

### Added

- Added `emails_as_csv` action for exporting email search results as CSV files attached to chat

### Fixed

- Fixed `add_category` to return a descriptive success message instead of the raw API response
- Fixed `remove_category` to return a descriptive success message instead of the raw API response
- Removed debug `print()` statements from `add_category` and attachment handling in `support.py`
Copy link
Contributor

@raivolink raivolink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikahanninen mikahanninen merged commit 8ebbfc5 into main Jan 30, 2026
7 checks passed
@mikahanninen mikahanninen deleted the add-emails-as-csv branch January 30, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants