Create and Export Files in MailAI Sandbox

Use MailAI's sandbox to create, format, and export files automatically. Generate CSV files, documents, and PDFs from your email data and workflows.

MMailAI Teamon June 12, 2025
Create and Export Files in MailAI Sandbox

MailAI's sandbox environment is a powerful feature that allows you to create, manipulate, and export files directly from your automated workflows. Whether you need CSV files for data analysis, formatted documents for reports, or PDFs for sharing, the sandbox makes it all possible without leaving your email automation.

What is the MailAI Sandbox?

The sandbox is a secure, isolated environment where MailAI can:

  • Create files in various formats (CSV, TXT, JSON, etc.)
  • Read and modify existing files
  • Format content according to your specifications
  • Export files for download or sharing
  • Process data before file creation

Think of it as a virtual workspace where your AI Autopilots can work with files just like you would on your computer.

Why Use the Sandbox for File Creation?

  • Automation: Generate files automatically from email content
  • Consistency: Standardized formats every time
  • Time Savings: No manual file creation or formatting
  • Integration: Files ready for external tools (Excel, databases, etc.)
  • Version Control: Track file creation with timestamps

Use Case 1: Creating CSV Files from Email Data

Generate structured CSV files from email content for analysis in Excel or databases.

CSV File Creation

Example: Contact List from Email Signatures

Prompt:

Monitor emails from the past 24 hours and extract contact information from email signatures.

For each email:
1. Extract: Name, Email, Company, Phone, Job Title, Website
2. Create a CSV file with these columns
3. Save as: contacts-YYYY-MM-DD.csv
4. Include header row
5. Format dates as YYYY-MM-DD

Output File Structure:

NameEmailCompanyPhoneJob TitleWebsiteDate Added
John Doejohn@example.comAcme Corp555-0100CEOhttps://acme.com2025-06-12
Jane Smithjane@tech.ioTechStart555-0200CTOhttps://techstart.io2025-06-12

Example: Expense Tracking from Receipt Emails

Prompt:

Monitor emails containing receipts, invoices, or expense confirmations (look for keywords: "receipt", "invoice", "payment confirmation", "expense").

For each receipt email:
1. Extract: Date, Vendor, Amount, Category, Payment Method, Description
2. Create/append to CSV: expenses-YYYY-MM.csv
3. Format amounts as numbers (no currency symbols in CSV)
4. Include currency in a separate "Currency" column
5. Categorize expenses: Travel, Software, Office Supplies, Meals, Other

Use Case 2: Creating Formatted Documents

Generate well-formatted text documents and reports from email content.

Document Creation

Example: Daily Summary Report

Prompt:

Analyze all emails from today and create a daily summary document.

1. Extract key information:
   - Important emails count
   - Action items
   - Meetings scheduled
   - Deadlines approaching
   - Key decisions made

2. Create a formatted document with:
   - Title: "Daily Summary - YYYY-MM-DD"
   - Executive Summary (2-3 sentences)
   - Section: Important Emails (list with sender and key points)
   - Section: Action Items (numbered list)
   - Section: Upcoming Deadlines (with dates)
   - Section: Decisions Made (bullet points)

3. Save as: daily-summary-YYYY-MM-DD.txt
4. Use clear section headers with === or ---
5. Format dates consistently

Output File Structure:

=== Daily Summary - 2025-06-12 ===

EXECUTIVE SUMMARY
Today's inbox contained 47 emails with 8 requiring action. Three important decisions were made regarding product roadmap and two deadlines are approaching this week.

IMPORTANT EMAILS
- From: product-team@example.com
  Subject: Q1 Roadmap Approval
  Key Points: Approved new feature set, budget allocated, timeline confirmed

- From: client@bigcorp.com
  Subject: Contract Renewal
  Key Points: Renewal terms discussed, pricing agreed, contract to be sent tomorrow

ACTION ITEMS
1. Review and approve contract terms (Due: Tomorrow)
2. Schedule team meeting for new feature planning (Due: This week)
3. Send follow-up email to client regarding implementation timeline (Due: Today)

UPCOMING DEADLINES
- Contract renewal response: 2025-06-13
- Q1 planning meeting: 2025-06-16

DECISIONS MADE
• Approved Q1 product roadmap with 5 new features
• Agreed to contract renewal terms with 15% increase
• Decided to expand team by 2 members in Q2

Example: Meeting Notes Compilation

Prompt:

Monitor emails containing meeting notes, summaries, or action items from meetings (look for keywords: "meeting notes", "action items", "follow-up", or calendar invites with notes).

For each meeting email:
1. Extract: Meeting title, Date, Attendees, Key discussion points, Action items, Decisions made
2. Create a formatted document: meeting-notes-YYYY-MM-DD-[meeting-title].txt
3. Format with clear sections and bullet points
4. Highlight action items with [ACTION] prefix

Use Case 3: Creating JSON Files for API Integration

Generate JSON files for integration with other tools and APIs.

Example: Lead Data in JSON Format

Prompt:

Monitor emails for lead inquiries and create a JSON file with structured data.

For each lead:
1. Extract: name, email, company, phone, inquiry_type, source, date, priority
2. Create JSON array in file: leads-YYYY-MM-DD.json
3. Format each lead as an object with proper JSON structure
4. Include metadata: total_leads, date_created, source_breakdown

Output File Structure:

{
  "metadata": {
    "total_leads": 5,
    "date_created": "2025-06-12",
    "source_breakdown": {
      "website": 3,
      "referral": 1,
      "email": 1
    }
  },
  "leads": [
    {
      "name": "John Doe",
      "email": "john@example.com",
      "company": "Acme Corp",
      "phone": "555-0100",
      "inquiry_type": "Product Demo",
      "source": "website",
      "date": "2025-06-12",
      "priority": "high"
    }
  ]
}

Use Case 4: Creating Markdown Documents

Generate Markdown-formatted documents for documentation, wikis, or GitHub.

Example: Knowledge Base Articles from Email

Prompt:

Monitor emails containing solutions, troubleshooting steps, or knowledge base content (look for keywords: "solution", "how to", "troubleshooting", "FAQ", "guide").

For each knowledge base email:
1. Extract: Title, Problem description, Solution steps, Related topics, Tags
2. Create a Markdown file: kb-article-[topic].md
3. Format with proper Markdown:
   - # for title
   - ## for sections
   - - for bullet points
   - ``` for code blocks
   - **bold** for emphasis
4. Include frontmatter with metadata

Output File Structure:

How to Reset Email Filters

Problem

Users are experiencing issues with email filters not working correctly after an update.

Solution

Step 1: Access Filter Settings

  1. Navigate to Settings > Email Filters
  2. Click on "Advanced Options"

Step 2: Reset Filters

  1. Select all filters
  2. Click "Reset to Default"
  3. Confirm the action

Step 3: Reconfigure

Follow the setup wizard to recreate your filters.

Related Topics

  • Email Organization
  • Filter Rules
  • Automation Setup

Best Practices for File Creation

1. Consistent Naming Conventions

  • Use dates: YYYY-MM-DD format
  • Include category: leads-, expenses-, reports-
  • Use dashes, not underscores
  • Include version if needed: report-v2-2025-06-12.txt

2. File Format Standards

  • CSV: Always include header row, use commas, handle quotes properly
  • JSON: Valid JSON syntax, proper indentation, include metadata
  • TXT: Clear formatting, consistent spacing, readable structure
  • Markdown: Follow Markdown standards, proper heading hierarchy

3. Data Validation

  • Check for required fields before creating files
  • Handle missing data gracefully (use "N/A" or empty strings)
  • Validate data formats (dates, numbers, emails)

4. File Organization

  • Group related files with consistent prefixes
  • Include dates for time-based files
  • Create README files for complex exports

5. Error Handling

  • Check if files exist before appending
  • Handle file creation errors gracefully
  • Include error messages in logs

Integration with External Tools

Your sandbox files can be used with:

  • Excel/Google Sheets: Import CSV files directly
  • Databases: Import CSV or JSON into SQL databases
  • Documentation Tools: Use Markdown files in wikis or GitHub
  • PDF Generators: Convert formatted text to PDF
  • APIs: Use JSON files for API integrations
  • Analytics Tools: Import data into BI tools

Troubleshooting

Files Not Being Created

  • Check sandbox permissions: Ensure Autopilot has file creation access
  • Verify file paths: Use correct file naming conventions
  • Review execution logs: Check automation results for errors

Format Issues

  • CSV encoding: Ensure UTF-8 encoding for special characters
  • JSON validity: Validate JSON syntax before saving
  • Date formats: Standardize all dates consistently

File Size Limits

  • Break large files: Split into multiple files if needed
  • Compress data: Use efficient data structures
  • Archive old files: Move historical data to archive files
    • Email Statistics
    • Important Communications
    • Action Items
    • Follow-ups Needed
    • Tomorrow's Priorities
  1. Create JSON file: daily-data-YYYY-MM-DD.json Structure: { "date": "YYYY-MM-DD", "statistics": {...}, "important_emails": [...], "action_items": [...], "metrics": {...} }

  2. All files should be saved in the sandbox with consistent naming

  3. Include timestamps in file metadata

Conclusion

The MailAI sandbox is a powerful tool for creating, formatting, and exporting files automatically. By leveraging AI Autopilots to generate CSV files, documents, JSON data, and more, you can transform your email workflows into comprehensive data management systems.

Start with simple file creation, refine your formats, and gradually build more complex multi-file workflows. Your email data becomes structured, searchable, and ready for analysis.

Ready to get started? Create your first file generation Autopilot today and experience the power of automated file creation and export.


Want to learn more? Check out our guides on research workflows and Slack automation.