2 Commits

Author SHA1 Message Date
dwindown
1573bff7b3 feat: Card-based email system implementation
##  Core Card System Complete!

### base.html Template
-  Single, theme-agnostic template
-  Card system CSS (default, highlight, info, warning, success, bg)
-  Customizable header (logo/text)
-  Customizable footer + social icons
-  Customizable body background
-  Mobile responsive
-  Email client compatible (Outlook, Gmail, etc.)

### EmailRenderer.php - Card Parser
-  `parse_cards()` - Parses [card]...[/card] syntax
-  `parse_card_attributes()` - Extracts type and bg attributes
-  `render_card()` - Renders card HTML
-  `render_card_spacing()` - 24px spacing between cards
-  `render_html()` - Email customization support
-  `get_social_icon_url()` - Social media icons

### Card Types Supported
```
[card]                        → Default white card
[card type="highlight"]       → Purple gradient card
[card type="info"]            → Blue info card
[card type="warning"]         → Yellow warning card
[card type="success"]         → Green success card
[card bg="https://..."]       → Background image card
```

### Email Customization
-  Header: Logo or text
-  Body background color
-  Footer text
-  Social media links (Facebook, Instagram, Twitter, LinkedIn)
-  Stored in `woonoow_notification_settings[email_appearance]`

### Default Templates Updated
-  order_placed_email - Multi-card layout
-  order_processing_email - Success card + summary
-  Other templates ready to update

---

**Architecture:**
```
Content with [card] tags
    ↓
parse_cards()
    ↓
render_card() × N
    ↓
base.html template
    ↓
Beautiful HTML email! 🎨
```

**Next:** Settings UI + Live Preview 🚀
2025-11-12 23:14:00 +07:00
dwindown
30384464a1 feat: Custom email system foundation
##  Step 1-3: Email System Core

### EmailManager.php
-  Disables WooCommerce emails (prevents duplicates)
-  Hooks into all WC order status changes
-  Hooks into customer, product events
-  Checks if events are enabled before sending
-  Sends via wp_mail() (SMTP plugin compatible)

### EmailRenderer.php
-  Renders emails with design templates
-  Variable replacement system
-  Gets recipient email (staff/customer)
-  Loads order/product/customer variables
-  Filter hook: `woonoow_email_template`
-  Supports HTML template designs

### Email Design Templates (3)
**templates/emails/modern.html**
-  Clean, minimalist, Apple-inspired
-  Dark mode support
-  Mobile responsive
-  2024 design trends

**templates/emails/classic.html**
-  Professional, traditional
-  Gradient header
-  Table styling
-  Business-appropriate

**templates/emails/minimal.html**
-  Ultra-clean, monospace font
-  Black & white aesthetic
-  Text-focused
-  Dark mode invert

### Architecture
```
Design Template (HTML) → Content Template (Text) → Final Email
   modern.html        →  order_processing      →  Beautiful HTML
```

---

**Next:** Rich text editor + Content templates 🎨
2025-11-12 18:48:55 +07:00