feat: Add comprehensive notification system with email support
- Create notification management system with VNotifications class - Build notification API endpoints (get, mark read, delete, preferences) - Implement notification bell UI widget with real-time polling - Add email queue system with digest support (instant/hourly/daily/weekly) - Create notification trigger helpers for common events - Add fine-grained user preference controls - Implement cron script for email processing and cleanup - Document setup and usage in docs/NOTIFICATIONS.md Features: - In-app notifications with dropdown - Email delivery with batching - 6 notification types (comment, like, subscribe, upload, mention, system) - User preference controls per notification type - Lightweight polling (30s interval) - Auto-cleanup of old notifications (90 days) - Production-ready with proper error handling
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Process Notification Email Queue
|
||||
* Run via cron every 5-15 minutes
|
||||
*/
|
||||
|
||||
require_once dirname(__DIR__, 2) . '/f_core/config.boot.php';
|
||||
require_once dirname(__DIR__, 2) . '/f_core/f_classes/class.notifications.php';
|
||||
require_once dirname(__DIR__, 2) . '/f_core/f_classes/class.logger.php';
|
||||
|
||||
$logger = new VLogger('email_queue');
|
||||
$notifications = new VNotifications();
|
||||
|
||||
$logger->info("Starting email queue processing");
|
||||
|
||||
$sent = $notifications->processEmailQueue(50);
|
||||
|
||||
$logger->info("Email queue processing complete. Sent: $sent emails");
|
||||
|
||||
// Clean up old notifications (older than 90 days)
|
||||
$deleted = $notifications->cleanup(90);
|
||||
|
||||
$logger->info("Cleaned up $deleted old notifications");
|
||||
|
||||
echo "Done. Sent: $sent, Cleaned: $deleted\n";
|
||||
Reference in New Issue
Block a user