```html

Automating Event Management and Service Dispatch: Building a Multi-Platform Calendar Integration System

This session involved significant infrastructure work to consolidate event management across multiple platforms and build automated dispatch systems for service coordination. The challenge: coordinating calendar events across Google Calendar, GetMyBoat, Boatsetter, and internal scheduling systems while maintaining a single source of truth.

What Was Done

  • Replaced Google Apps Script-based calendar sync with a Lambda-driven API architecture
  • Built automated boat cleaning dispatch pipeline triggered by calendar events
  • Implemented email-driven event ingestion from third-party booking platforms
  • Created campaign scheduling system for multi-channel marketing communications
  • Integrated platform inbox scraping with event management workflows

Calendar Architecture: Moving from Apps Script to Lambda

The original system used Google Apps Script (GAS) for calendar synchronization, but this approach had scalability and maintainability limitations. The migration involved:

Original Setup (CalendarSync.gs):

Location: /Users/cb/Documents/repos/sites/queenofsandiego.com/rady-shell-events/apps-script-replacement/CalendarSync.gs
- Time-driven triggers polling external calendars
- Bidirectional sync between Google Calendar and booking platforms
- Email-based event notifications

New Architecture:

  • API Layer: Lambda function exposing calendar operations via API Gateway v2
  • Actions Supported: add-calendar-event, get-calendar-events, update-calendar-event
  • Authentication: Dashboard token validation via repos.env configuration
  • Data Flow: Calendar requests routed through API Gateway → Lambda → Google Calendar API

Why This Matters: Lambda provides better observability, easier debugging, and separation of concerns. The previous polling-based approach could miss events and created race conditions during rapid scheduling.

Event Ingestion Pipeline

Multiple booking platforms feed events into the calendar system:

  • GetMyBoat / Boatsetter: Calendar credentials stored in CalendarSync.gs; iCal feeds processed via Lambda
  • Email-Based Events: Scraped from platform inboxes (Gmail API) and converted to calendar entries
  • Manual Events: Added via dashboard API with timestamp validation

Example Implementation:

File: /Users/cb/Documents/repos/tools/platform_inbox_scraper.py
- Queries Gmail API for booking confirmations
- Parses event details (date, location, duration)
- Submits to calendar API endpoint for persistence
- Deployment: deploy_inbox_scraper.sh (automated via Lambda scheduled event)

Automated Dispatch System for Service Coordination

The boat cleaning dispatch system demonstrates event-driven automation:

Core Components:

  • Trigger: Calendar event matching pattern (day-of-week, location, service type)
  • Dispatch Logic: /Users/cb/Documents/repos/tools/dispatch_boat_cleaner.py
    • Reads calendar events from Lambda API
    • Filters for boat-related events (GetMyBoat/Boatsetter bookings)
    • Generates work orders with required task details
    • Integrates with task management system
  • Execution: Scheduled Lambda invocation or dashboard card trigger

Workflow Example:

GetMyBoat booking → Email inbox → Scraper parses event → Calendar API stores
  → Dispatch system detects booking date → Generates cleaning task
  → Service provider receives work order

Campaign Scheduling Infrastructure

A separate but related system manages marketing communications:

Files Created:
- /Users/cb/Documents/repos/tools/campaign_schedule.json (config)
- /Users/cb/Documents/repos/tools/campaign_scheduler.py (orchestration)
- /Users/cb/Documents/repos/tools/deploy_campaign_scheduler.sh (deployment)

Architecture Decisions:

  • JSON Configuration: Campaign timing, recipient lists, template selection stored as code
  • Multi-Template Support:
    • /Users/cb/Documents/repos/tools/templates/rady_shell_blast1.html
    • /Users/cb/Documents/repos/tools/templates/rady_shell_blast2.html
  • Email Service: AWS SES for deliverability and bounce handling
  • Scheduling: CloudWatch Events triggers Lambda on defined intervals

This separation allows marketing campaigns to run independently of event management, reducing cross-system dependencies.

Site-Specific Implementations

QuickDumpNow.com Consumer Blast System:

Files:
- /Users/cb/Documents/repos/sites/quickdumpnow.com/tools/qdn_consumer_blast.py
- /Users/cb/Documents/repos/sites/quickdumpnow.com/tools/qdn_stats.py
- /Users/cb/Documents/repos/sites/quickdumpnow.com/unsubscribe/index.html (unsubscribe landing page)

Key Features:

  • Segmented recipient targeting (environmental consciousness scoring)
  • Template A/B testing infrastructure
  • Unsubscribe compliance with GDPR/CAN-SPAM (landing page + database update)
  • Statistical tracking: open rates, click rates, conversion metrics

QueenOfSanDiego.com Event Management:

Files:
- /Users/cb/Documents/repos/sites/queenofsandiego.com/rady-shell-events/sites/birthday/index.html
- /Users/cb/Documents/repos/sites/queenofsandiego.com/rady-shell-events/sites/birthday-afternoon/index.html

Multiple event landing pages allow granular event tracking and custom messaging per event type (birthday morning vs. afternoon slots).

Infrastructure and Deployment Strategy

  • Secrets Management: repos.env contains API endpoints, Lambda function names, dashboard tokens
  • Credentials: Google Calendar API creds stored in Lambda environment variables; GAS project IDs mapped via .clasp.json files
  • Deployment: Shell scripts handle code push to GAS and Lambda updates
  • Monitoring: CloudWatch Logs captures all API calls and dispatch execution

Key Technical Decisions

  • Why Lambda over Apps Script? Better error handling, observability, and separation of calendar logic from UI scripts. Apps Script is excellent for