Mail Tool
Purpose
Send emails directly to users with rich formatting support
Description
The Mail tool enables agents to send professional emails directly to users through Mailgun integration, supporting both plain text and HTML formatting for rich communication.
Key Features
- Plain text and HTML email support
- Automatic user email resolution from user ID
- Sender domain is
agent.teamday.ai - No user confirmation required for sending
- Comprehensive delivery tracking and error handling
Parameters
- subject (string): Email subject line
- textContent (string): Plain text version of email content
- htmlContent (string, optional): HTML version for rich formatting
Email Configuration
- Sender Domain:
agent.teamday.ai - From Address:
Teamday.ai - agent <[email protected]> - To Address: Automatically resolved from user's account
- Server Region: EU-based Mailgun servers
Features
Automatic User Resolution
- Retrieves user email from Firebase Authentication
- No need to specify recipient email address
- Secure user data access through user ID
Rich Content Support
- Plain Text: Always included for compatibility
- HTML Content: Optional rich formatting with images, styling, links
- Dual Format: Both versions sent when HTML provided
Professional Delivery
- Custom sender domain for professional appearance
- Proper email headers and authentication
- EU-compliance with GDPR requirements
Response Format
Returns detailed delivery information:
- success: Boolean indicating send status
- messageId: Unique identifier for tracking
- details: Delivery confirmation message
- mail: Recipient email address
- hasHtml: Boolean indicating HTML content inclusion
Use Cases
- Task Completion Notifications: Inform users when tasks are complete
- Report Delivery: Send generated reports and analyses
- Alert Messages: Important notifications and updates
- Summary Communications: Project updates and progress reports
- Rich Content: Formatted reports with charts and styling
- Follow-up Communications: Automated follow-ups and reminders
Technical Implementation
- Mailgun API: EU-based servers for GDPR compliance
- Authentication: API key-based secure access
- User Resolution: Firebase Authentication integration
- Error Handling: Comprehensive failure reporting
- Message Tracking: Unique ID for delivery confirmation
Security & Privacy
- User email addresses securely retrieved from authentication system
- No email addresses stored or logged
- EU-based email processing for privacy compliance
- Secure API key management
Best Practices
- Always provide meaningful subject lines
- Include plain text version for accessibility
- Use HTML sparingly for better deliverability
- Keep content concise and professional
- Consider user preferences and frequency
Error Handling
- Missing API key detection
- User email resolution failures
- Mailgun service availability
- Network connectivity issues
- Rate limiting and quota management