UNPKG

cakemail-mcp-server

Version:

Enterprise MCP server for Cakemail API integration with Claude AI - includes comprehensive template management, list management, sub-account management, BEEeditor visual email design, and advanced analytics

160 lines (125 loc) 5.9 kB
# BEEeditor Integration Implementation Summary ## ✅ Implementation Completed The BEEeditor integration has been successfully added to the Cakemail MCP Server. Here's what has been implemented: ### 🏗️ Core Infrastructure 1. **Schema Support**: Added `simple_unified.schema.json` to `/src/schema/` defining the complete BEEeditor JSON format 2. **Type Definitions**: Created comprehensive TypeScript types in `/src/types/bee-editor.ts` for: - BEE template structure (rows, columns, modules) - All 10 module types (button, divider, heading, html, icons, image, list, menu, paragraph, title) - Template settings and metadata - Validation interfaces 3. **Utility Functions**: Built powerful utilities in `/src/utils/bee-editor.ts` for: - Creating basic BEE templates - Generating newsletter templates with multiple sections - Validating templates against schema - Adding/manipulating template content - Converting BEE data to Cakemail requests - Template structure visualization ### 🛠️ New Tools Added 1. **Enhanced Campaign Tools**: - `cakemail_create_campaign` - Now supports both HTML and BEE formats - `cakemail_update_campaign` - Can update campaigns with BEE content 2. **BEE-Specific Tools**: - `cakemail_create_bee_template` - Create basic BEE template structures - `cakemail_create_bee_newsletter` - Generate complete newsletter templates - `cakemail_validate_bee_template` - Validate BEE JSON against schema ### 📝 Enhanced Handlers Updated campaign handlers in `/src/handlers/campaigns.ts` to: - Support BEE JSON content in campaign creation/updates - Validate BEE templates before processing - Provide detailed error messages for validation failures - Show template structure visualization in responses - Handle both HTML and BEE content types seamlessly ### 🎯 Features 1. **Template Creation**: - Basic template generation with customizable settings - Newsletter template with header, content sections, and footer - Support for images, buttons, text, and layout elements - Responsive column layouts (1-12 weight system) 2. **Content Management**: - Rich text modules (titles, paragraphs, lists) - Interactive elements (buttons, links, images) - Layout controls (dividers, spacing, colors) - Multiple content sections with flexible layouts 3. **Validation & Debugging**: - Schema validation against BEE specification - Detailed error reporting for invalid templates - Template structure visualization - Content validation (required fields, data types, ranges) ### 📚 Documentation 1. **Comprehensive Guide**: `/docs/BEE_EDITOR_INTEGRATION.md` with: - Overview of BEE integration - Tool documentation with examples - Template structure explanations - Best practices and troubleshooting 2. **Template Examples**: `/examples/bee-templates.md` with: - 3 complete template examples (welcome, newsletter, event) - Usage instructions for each template - Customization tips and guidelines 3. **Updated README**: Added BEE integration information to main documentation ### 🔧 Integration Points 1. **Tool Registration**: All new tools registered in tool configuration and handlers 2. **API Integration**: BEE content properly formatted for Cakemail API 3. **Error Handling**: Comprehensive error handling for validation and API calls 4. **Type Safety**: Full TypeScript support with proper type definitions ## 🚀 Usage Examples ### Creating a BEE Newsletter Template ```javascript const newsletter = await cakemail_create_bee_newsletter({ "title": "Monthly Update", "subject": "What's New This Month", "contentSections": [ { "title": "Product Launch", "content": "Introducing our latest innovation...", "buttonText": "Learn More", "buttonUrl": "https://example.com/product" } ] }); ``` ### Creating a Campaign with BEE Content ```javascript const campaign = await cakemail_create_campaign({ "name": "Newsletter Campaign", "subject": "Monthly Update", "list_id": "123", "sender_id": "456", "content_type": "bee", "json_content": newsletter.json_content }); ``` ### Validating a Custom Template ```javascript const validation = await cakemail_validate_bee_template({ "json_content": customTemplate }); ``` ## 🎨 Supported BEE Elements - **Layout**: Rows and columns with flexible weights (1-12 system) - **Typography**: Titles (h1, h2, h3), paragraphs, lists with styling - **Interactive**: Buttons with hover effects, linked images - **Media**: Images with responsive sizing and linking - **Design**: Dividers, spacing controls, color schemes - **Structure**: Header, content, footer sections ## ✨ Key Benefits 1. **Visual Design**: Create professional emails without writing HTML 2. **Responsive**: Templates adapt to different screen sizes 3. **Validation**: Ensures templates meet BEE specification 4. **Flexibility**: Support for both simple and complex layouts 5. **Integration**: Seamless integration with existing Cakemail workflows 6. **Type Safety**: Full TypeScript support prevents runtime errors ## 🔜 Future Enhancements Potential future additions could include: - Template library management - Advanced module types (social media, video embeds) - Theme system for consistent branding - Template importing/exporting - Visual template preview generation ## 📋 Testing To test the BEE integration: 1. **Basic Template**: `"Create a basic BEE template for welcome emails"` 2. **Newsletter**: `"Generate a BEE newsletter with product announcements"` 3. **Validation**: `"Validate this BEE template" + provide JSON` 4. **Campaign**: `"Create a campaign using BEE format with a professional layout"` The integration is now ready for use and provides a powerful way to create visually appealing emails using the BEEeditor JSON format within the Cakemail MCP Server ecosystem.