Files
dwindown 7394d2f213 feat: Add comprehensive email flow diagnostics and logging
🔍 Email Flow Diagnostic Tool:
Created test-email-flow.php - comprehensive diagnostic dashboard:
- System status (notification mode, email channel, Action Scheduler)
- Event configuration checker
- Email queue status (wp_options)
- Action Scheduler queue status
- Recent email logs viewer
- Test actions (queue test email, process queue, test order email)
- Troubleshooting guide

📝 Enhanced Debug Logging:
Added detailed logging to EmailManager:
- Hook trigger logging
- Order validation logging
- Event enabled/disabled logging
- Email rendering status
- wp_mail() call result
- Full email flow traceability

🎯 Usage:
1. Visit: /wp-content/plugins/woonoow/test-email-flow.php
2. Check all system status indicators
3. Use test buttons to trigger emails
4. Monitor debug logs for detailed flow

📋 Logs to Watch:
[EmailManager] send_order_processing_email triggered
[EmailManager] order_processing email is disabled/enabled
[EmailManager] Sending order_processing email
[EmailManager] Email rendered successfully
[EmailManager] wp_mail called - Result: success/failed
[WooNooW MailQueue] Queued email ID
[WooNooW MailQueue] Processing email_id
[WooNooW MailQueue] Sent and deleted email ID

🚀 Troubleshooting Steps:
1. Check notification system mode (woonoow vs woocommerce)
2. Check email channel enabled
3. Check event-specific email enabled
4. Check Action Scheduler for failures
5. Check debug logs for flow
6. Test with diagnostic tool
2025-11-18 15:44:08 +07:00
..