Skip to main content

Email & Automations

Goal​

Provide store owners with customizable email templates and automation workflows for customer engagement, similar to AutomateWoo.

Entitlement Key​

email_automation

Available Plans​

  • Professional
  • Business
  • Enterprise

Features​

Email Template System​

  • Brand profile customization:
    • Logo, colors (primary, secondary, text, background)
    • Typography (font family, footer text)
    • Social links (Facebook, Twitter, Instagram, LinkedIn, YouTube, Pinterest)
    • Custom CSS
  • Template editor:
    • Subject line, heading, body (HTML + plain text)
    • Dynamic placeholders with live preview
    • Test email sending
  • WooCommerce email override:
    • Toggle to use custom templates for transactional emails
    • Support for order, customer, and system emails

Workflow Engine​

  • Visual workflow builder
  • Triggers:
    • Order events (created, processing, completed, cancelled, refunded, on-hold)
    • Customer events (registered, first order)
    • Cart abandoned
    • Back in stock
  • Conditions/Rules:
    • Customer role, order total, cart subtotal
    • Product/category/tag in order
    • Currency, shipping/billing country
    • First-time customer, order count, total spent
    • Match type: ALL or ANY
  • Actions:
    • Send email (customer, admin, or custom recipient)
    • Add/remove customer tag
    • Add customer/order note
    • Create coupon (percent, fixed cart, fixed product)
    • Delay (minutes, hours, days)
    • Change order status

Abandoned Cart Recovery​

  • Automatic cart detection (60+ minute inactivity)
  • Cart tracking with session, user, and email
  • Recovery workflow triggers
  • Recovery status tracking

Background Jobs​

  • aiowc_ea_detect_abandoned_carts - Every 15 minutes
  • aiowc_ea_run_workflow_action - Delayed action execution
  • aiowc_ea_cleanup_logs - Daily log cleanup (30-day retention)

Database Tables​

TablePurpose
aiowc_email_brand_profileBrand styling configuration
aiowc_email_templatesEmail template content
aiowc_workflowsWorkflow definitions
aiowc_workflow_logsExecution history
aiowc_abandoned_cartsCart tracking
aiowc_workflow_executionsIdempotency tracking

Admin UI​

Tabs​

  1. Templates - Brand profile editor, template list/editor, preview
  2. Workflows - Workflow list, visual builder (trigger, rules, actions)
  3. Logs - Execution history with filters and detail view
  4. Diagnostics - System health checks, cleanup tools

REST API Endpoints​

MethodEndpointDescription
GET/email-automation/overviewDashboard stats
GET/PUT/email-automation/brand-profileBrand settings
GET/email-automation/templatesList templates
GET/PUT/email-automation/templates/:idSingle template
POST/email-automation/templates/:id/resetReset to default
GET/POST/email-automation/workflowsList/create workflows
GET/PUT/DELETE/email-automation/workflows/:idSingle workflow
POST/email-automation/workflows/:id/toggleEnable/disable
POST/email-automation/workflows/:id/duplicateClone workflow
GET/email-automation/logsPaginated logs
GET/email-automation/logs/:idSingle log detail
POST/email-automation/previewPreview email HTML
POST/email-automation/send-testSend test email
GET/email-automation/diagnosticsHealth checks
POST/email-automation/cleanupManual cleanup

File Structure​

includes/Modules/EmailAutomation/
├── EmailAutomationModule.php
├── Schema/DatabaseSchema.php
├── DTO/
│ ├── BrandProfile.php
│ ├── EmailTemplate.php
│ ├── Workflow.php
│ ├── WorkflowAction.php
│ ├── WorkflowRule.php
│ └── WorkflowLog.php
├── Repository/
│ ├── BrandProfileRepository.php
│ ├── EmailTemplateRepository.php
│ ├── WorkflowRepository.php
│ ├── WorkflowLogRepository.php
│ └── AbandonedCartRepository.php
├── Service/
│ ├── EmailRenderer.php
│ ├── TemplateOverrideService.php
│ ├── PlaceholderResolver.php
│ ├── TriggerRegistry.php
│ ├── RuleEvaluator.php
│ ├── ActionExecutor.php
│ ├── WorkflowEngine.php
│ ├── IdempotencyService.php
│ ├── AbandonedCartDetector.php
│ └── DiagnosticsService.php
├── Rest/EmailAutomationRest.php
├── Frontend/EmailPreviewHandler.php
└── Jobs/
├── AbandonedCartDetectorJob.php
├── WorkflowRunnerJob.php
└── LogCleanupJob.php

Observability Events​

EventProperties
email_template_updatedtemplateKey
email_test_senttemplateKey, recipient
workflow_createdtriggerType, actionsCount
workflow_toggledworkflowId, enabled
workflow_trigger_firedtriggerType, workflowId
workflow_action_executedactionType, success
abandoned_cart_detectedcartTotal, hasEmail