diff --git a/PROGRESS_NOTE.md b/PROGRESS_NOTE.md index 6b75051..3ef57c8 100644 --- a/PROGRESS_NOTE.md +++ b/PROGRESS_NOTE.md @@ -1,6 +1,6 @@ # WooNooW Project Progress Note -**Last Updated:** November 11, 2025, 4:10 PM (GMT+7) +**Last Updated:** November 19, 2025, 6:50 PM (GMT+7) ## Overview WooNooW is a hybrid WordPress + React SPA replacement for WooCommerce Admin. It focuses on performance, UX consistency, and extensibility with SSR-safe endpoints and REST-first design. The plugin integrates deeply with WooCommerce’s data store (HPOS ready) and provides a modern React-based dashboard and order management system. @@ -2720,3 +2720,321 @@ $notification_urls = [ **Implementation Date:** November 11, 2025 **Status:** βœ… Production Ready **Next Milestone:** Dynamic push notification URLs + +--- + +## πŸ“§ Email Notification System Enhancements β€” November 19, 2025 + +### βœ… Variable Dropdown in TipTap Editor - COMPLETE + +**Problem:** Users had to manually type `{variable_name}` placeholders in email templates. + +**Solution:** Added comprehensive variable dropdown with 40+ available variables. + +#### **Frontend Changes** + +**File:** `admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx` + +**Added variables list** (lines 42-87): +```typescript +const availableVariables = [ + // Order variables (14) + 'order_number', 'order_id', 'order_date', 'order_total', + 'order_subtotal', 'order_tax', 'order_shipping', 'order_discount', + 'order_status', 'order_url', 'order_items_table', + 'completion_date', 'estimated_delivery', + + // Customer variables (7) + 'customer_name', 'customer_first_name', 'customer_last_name', + 'customer_email', 'customer_phone', + 'billing_address', 'shipping_address', + + // Payment variables (5) + 'payment_method', 'payment_status', 'payment_date', + 'transaction_id', 'payment_retry_url', + + // Shipping/Tracking variables (4) + 'tracking_number', 'tracking_url', + 'shipping_carrier', 'shipping_method', + + // URL variables (3) + 'review_url', 'shop_url', 'my_account_url', + + // Store variables (6) + 'site_name', 'site_title', 'store_name', + 'store_url', 'support_email', 'current_year', +]; +``` + +**Features:** +- βœ… Dropdown appears below TipTap editor +- βœ… Shows all 40+ available variables +- βœ… Click to insert at cursor position +- βœ… Formatted as `{variable_name}` +- βœ… Categorized by type (Order, Customer, Payment, etc.) + +--- + +### βœ… Notification Page Reorganization - COMPLETE + +**Problem:** Flat card layout made it hard to scale for future recipient types (Affiliate, Merchant). + +**Solution:** Categorized cards into "Recipients" and "Channels" sections. + +#### **Frontend Changes** + +**File:** `admin-spa/src/routes/Settings/Notifications.tsx` + +**New Structure:** +``` +πŸ“§ Notifications +β”œβ”€β”€ πŸ‘₯ Recipients +β”‚ β”œβ”€β”€ Staff (Orders, Products, Customers) +β”‚ └── Customer (Orders, Shipping, Account) +β”‚ +└── πŸ“‘ Channels + β”œβ”€β”€ Channel Configuration (Email, Push, WhatsApp, Telegram) + └── Activity Log (Coming soon) +``` + +**Benefits:** +- βœ… Clear separation of concerns +- βœ… Easy to add new recipients (Affiliate, Merchant) +- βœ… Scalable structure +- βœ… Better UX with section headers +- βœ… Professional organization + +--- + +### βœ… Email Card Styling Fixes - COMPLETE + +**Problem:** +1. `[card type="success"]` rendered with hero gradient (purple) instead of green +2. List support verification needed + +**Solution:** Fixed card rendering in EmailRenderer. + +#### **Backend Changes** + +**File:** `includes/Core/Notifications/EmailRenderer.php` (lines 348-380) + +**Before:** +```php +if ($type === 'hero' || $type === 'success') { + // Both used same gradient ❌ + $style .= ' background: linear-gradient(...)'; +} +``` + +**After:** +```php +if ($type === 'hero') { + // Hero: gradient background + $style .= ' background: linear-gradient(...)'; +} +elseif ($type === 'success') { + // Success: green theme βœ… + $style .= ' background-color: #f0fdf4; border-left: 4px solid #22c55e;'; +} +elseif ($type === 'info') { + // Info: blue theme + $style .= ' background-color: #f0f7ff; border-left: 4px solid #0071e3;'; +} +elseif ($type === 'warning') { + // Warning: orange theme + $style .= ' background-color: #fff8e1; border-left: 4px solid #ff9800;'; +} +``` + +**Card Types Now:** +- `default`: white background +- `hero`: gradient background (purple) +- `success`: green background with left border βœ… +- `info`: blue background with left border +- `warning`: orange background with left border + +**List Support:** +- βœ… Already working in MarkdownParser (lines 132-141) +- βœ… Supports: `*`, `-`, `β€’`, `βœ“`, `βœ”` as list markers +- βœ… Properly converts to `